Skip to content

Commit

Permalink
fix: fix wrong file name & fix implementation of processor follow sta…
Browse files Browse the repository at this point in the history
…ndard
  • Loading branch information
a3828162 committed Jun 25, 2024
1 parent 0465bd4 commit 4e578fd
Show file tree
Hide file tree
Showing 12 changed files with 489 additions and 777 deletions.
29 changes: 3 additions & 26 deletions internal/sbi/api_eventexposure.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,30 +78,14 @@ func (s *Server) HandleCreateEeSubscription(c *gin.Context) {

ueIdentity := c.Params.ByName("ueIdentity")

createdEESubscription, problemDetails := s.Processor().CreateEeSubscriptionProcedure(ueIdentity, eesubscription)
if createdEESubscription != nil {
c.JSON(http.StatusCreated, createdEESubscription)
return
} else if problemDetails != nil {
c.JSON(int(problemDetails.Status), problemDetails)
return
} else {
problemDetails = &models.ProblemDetails{
Status: http.StatusInternalServerError,
Cause: "UNSPECIFIED_NF_FAILURE",
}
c.JSON(http.StatusInternalServerError, problemDetails)
return
}
s.Processor().CreateEeSubscriptionProcedure(c, ueIdentity, eesubscription)
}

func (s *Server) HandleDeleteEeSubscription(c *gin.Context) {
ueIdentity := c.Params.ByName("ueIdentity")
subscriptionID := c.Params.ByName("subscriptionId")

s.Processor().DeleteEeSubscriptionProcedure(ueIdentity, subscriptionID)
// only return 204 no content
c.Status(http.StatusNoContent)
s.Processor().DeleteEeSubscriptionProcedure(c, ueIdentity, subscriptionID)
}

func (s *Server) HandleUpdateEeSubscription(c *gin.Context) {
Expand Down Expand Up @@ -139,14 +123,7 @@ func (s *Server) HandleUpdateEeSubscription(c *gin.Context) {
logger.EeLog.Infoln("Handle Update EE subscription")
logger.EeLog.Warnln("Update EE Subscription is not implemented")

problemDetails := s.Processor().UpdateEeSubscriptionProcedure(ueIdentity, subscriptionID, patchList)
if problemDetails != nil {
c.JSON(int(problemDetails.Status), problemDetails)
return
} else {
c.Status(http.StatusNoContent)
return
}
s.Processor().UpdateEeSubscriptionProcedure(c, ueIdentity, subscriptionID, patchList)
}

func (s *Server) HandleIndex(c *gin.Context) {
Expand Down
11 changes: 1 addition & 10 deletions internal/sbi/api_httpcallback.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,5 @@ func (s *Server) HandleDataChangeNotificationToNF(c *gin.Context) {

logger.CallbackLog.Infof("Handle DataChangeNotificationToNF")

problemDetails := s.Processor().DataChangeNotificationProcedure(dataChangeNotify.NotifyItems, supi)

// step 4: process the return value from step 3
if problemDetails != nil {
c.JSON(int(problemDetails.Status), problemDetails)
return
} else {
c.Status(http.StatusNoContent)
return
}
s.Processor().DataChangeNotificationProcedure(c, dataChangeNotify.NotifyItems, supi)
}
11 changes: 1 addition & 10 deletions internal/sbi/api_parameterprovision.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,5 @@ func (s *Server) HandleUpdate(c *gin.Context) {
logger.PpLog.Infoln("Handle UpdateRequest")

// step 3: handle the message
problemDetails := s.Processor().UpdateProcedure(ppDataReq, gpsi)

// step 4: process the return value from step 3
if problemDetails != nil {
c.JSON(int(problemDetails.Status), problemDetails)
return
} else {
c.Status(http.StatusNoContent)
return
}
s.Processor().UpdateProcedure(c, ppDataReq, gpsi)
}
Loading

0 comments on commit 4e578fd

Please sign in to comment.