Skip to content

Commit

Permalink
fix: gin context parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
a3828162 committed Aug 9, 2024
1 parent 81bc721 commit 363af77
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion internal/sbi/api_parameterprovision.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (s *Server) HandleUpdate(c *gin.Context) {
return
}

gpsi := c.Params.ByName("gpsi")
gpsi := c.Params.ByName("ueId")
if gpsi == "" {
problemDetails := &models.ProblemDetails{
Status: http.StatusBadRequest,
Expand Down
11 changes: 4 additions & 7 deletions internal/sbi/api_subscriberdatamanagement.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func (s *Server) HandleSubscribe(c *gin.Context) {

logger.SdmLog.Infof("Handle Subscribe")

supi := c.Params.ByName("supi")
supi := c.Params.ByName("ueId")

s.Processor().SubscribeProcedure(c, &sdmSubscriptionReq, supi)
}
Expand All @@ -214,7 +214,7 @@ func (s *Server) HandleSubscribe(c *gin.Context) {
func (s *Server) HandleUnsubscribe(c *gin.Context) {
logger.SdmLog.Infof("Handle Unsubscribe")

supi := c.Params.ByName("supi")
supi := c.Params.ByName("ueId")
subscriptionID := c.Params.ByName("subscriptionId")

s.Processor().UnsubscribeProcedure(c, supi, subscriptionID)
Expand Down Expand Up @@ -259,7 +259,7 @@ func (s *Server) HandleModify(c *gin.Context) {

logger.SdmLog.Infof("Handle Modify")

supi := c.Params.ByName("supi")
supi := c.Params.ByName("ueId")
subscriptionID := c.Params.ByName("subscriptionId")

s.Processor().ModifyProcedure(c, &sdmSubsModificationReq, supi, subscriptionID)
Expand Down Expand Up @@ -377,7 +377,7 @@ func (s *Server) HandleGetIdTranslationResult(c *gin.Context) {

logger.SdmLog.Infof("Handle GetIdTranslationResultRequest")

gpsi := c.Params.ByName("gpsi")
gpsi := c.Params.ByName("ueId")

s.Processor().GetIdTranslationResultProcedure(c, gpsi)
}
Expand Down Expand Up @@ -419,7 +419,6 @@ func (s *Server) TwoLayerPathHandlerFunc(c *gin.Context) {

// for "/:ueId/id-translation-result"
if op == "id-translation-result" && strings.ToUpper("Get") == c.Request.Method {
c.Params = append(c.Params, gin.Param{Key: "ueId", Value: c.Param("supi")})
s.HandleGetIdTranslationResult(c)
return
}
Expand All @@ -441,7 +440,6 @@ func (s *Server) ThreeLayerPathHandlerFunc(c *gin.Context) {
// for "/:ueId/sdm-subscriptions/:subscriptionId"
if op == "sdm-subscriptions" && strings.ToUpper("Delete") == c.Request.Method {
var tmpParams gin.Params
tmpParams = append(tmpParams, gin.Param{Key: "ueId", Value: c.Param("supi")})
tmpParams = append(tmpParams, gin.Param{Key: "subscriptionId", Value: c.Param("thirdLayer")})
c.Params = tmpParams
s.HandleUnsubscribe(c)
Expand All @@ -457,7 +455,6 @@ func (s *Server) ThreeLayerPathHandlerFunc(c *gin.Context) {
// for "/:ueId/sdm-subscriptions/:subscriptionId"
if op == "sdm-subscriptions" && strings.ToUpper("Patch") == c.Request.Method {
var tmpParams gin.Params
tmpParams = append(tmpParams, gin.Param{Key: "ueId", Value: c.Param("supi")})
tmpParams = append(tmpParams, gin.Param{Key: "subscriptionId", Value: c.Param("thirdLayer")})
c.Params = tmpParams
s.HandleModify(c)
Expand Down
1 change: 0 additions & 1 deletion internal/sbi/api_ueauthentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ func (s *Server) HandleGenerateAuthData(c *gin.Context) {
}

func (s *Server) GenAuthDataHandlerFunc(c *gin.Context) {
c.Params = append(c.Params, gin.Param{Key: "supiOrSuci", Value: c.Param("supi")})
if strings.ToUpper("Post") == c.Request.Method {
s.HandleGenerateAuthData(c)
return
Expand Down

0 comments on commit 363af77

Please sign in to comment.