Skip to content

Commit

Permalink
fix: fix PR comment
Browse files Browse the repository at this point in the history
  • Loading branch information
a3828162 committed Jun 25, 2024
1 parent 4e578fd commit 0001050
Showing 1 changed file with 9 additions and 21 deletions.
30 changes: 9 additions & 21 deletions internal/sbi/processor/ue_context_management.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,8 @@ func (p *Processor) RegistrationAmf3gppAccessProcedure(c *gin.Context,

c.JSON(http.StatusOK, registerRequest)
} else {
header := make(http.Header)
udmUe, _ := udm_context.GetSelf().UdmUeFindBySupi(ueID)
header.Set("Location", udmUe.GetLocationURI(udm_context.LocationUriAmf3GppAccessRegistration))
for key, val := range header { // header response is optional
c.Header(key, val[0])
}
udmUe, _ := p.Context().UdmUeFindBySupi(ueID)
c.Header("Location", udmUe.GetLocationURI(udm_context.LocationUriAmf3GppAccessRegistration))
c.JSON(http.StatusCreated, registerRequest)
}
}
Expand Down Expand Up @@ -230,12 +226,8 @@ func (p *Processor) RegisterAmfNon3gppAccessProcedure(c *gin.Context,

return
} else {
header := make(http.Header)
udmUe, _ := udm_context.GetSelf().UdmUeFindBySupi(ueID)
header.Set("Location", udmUe.GetLocationURI(udm_context.LocationUriAmfNon3GppAccessRegistration))
for key, val := range header { // header response is optional
c.Header(key, val[0])
}
udmUe, _ := p.Context().UdmUeFindBySupi(ueID)
c.Header("Location", udmUe.GetLocationURI(udm_context.LocationUriAmfNon3GppAccessRegistration))
c.JSON(http.StatusCreated, registerRequest)
}
}
Expand Down Expand Up @@ -487,7 +479,7 @@ func (p *Processor) DeregistrationSmfRegistrationsProcedure(c *gin.Context,

func (p *Processor) RegistrationSmfRegistrationsProcedure(
c *gin.Context,
request *models.SmfRegistration,
smfRegistration *models.SmfRegistration,
ueID string,
pduSessionID string,
) {
Expand All @@ -509,7 +501,7 @@ func (p *Processor) RegistrationSmfRegistrationsProcedure(
pduID32 := int32(pduID64)

var createSmfContextNon3gppParamOpts Nudr_DataRepository.CreateSmfContextNon3gppParamOpts
optInterface := optional.NewInterface(*request)
optInterface := optional.NewInterface(*smfRegistration)
createSmfContextNon3gppParamOpts.SmfRegistration = optInterface

clientAPI, err := p.consumer.CreateUDMClientToUDR(ueID)
Expand Down Expand Up @@ -539,12 +531,8 @@ func (p *Processor) RegistrationSmfRegistrationsProcedure(
if contextExisted {
c.Status(http.StatusNoContent)
} else {
header := make(http.Header)
udmUe, _ := udm_context.GetSelf().UdmUeFindBySupi(ueID)
header.Set("Location", udmUe.GetLocationURI(udm_context.LocationUriSmfRegistration))
for key, val := range header { // header response is optional
c.Header(key, val[0])
}
c.JSON(http.StatusCreated, request)
udmUe, _ := p.Context().UdmUeFindBySupi(ueID)
c.Header("Location", udmUe.GetLocationURI(udm_context.LocationUriSmfRegistration))
c.JSON(http.StatusCreated, smfRegistration)
}
}

0 comments on commit 0001050

Please sign in to comment.