Skip to content

Commit

Permalink
feat: add notimplement route & fix gin context parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
a3828162 committed Aug 13, 2024
1 parent 363af77 commit fc69b8a
Show file tree
Hide file tree
Showing 4 changed files with 539 additions and 1 deletion.
121 changes: 121 additions & 0 deletions internal/sbi/api_parameterprovision.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,83 @@ func (s *Server) getParameterProvisionRoutes() []Route {
"/:ueId/pp-data",
s.HandleUpdate,
},

{
"Create5GMBSGroup",
strings.ToUpper("Put"),
"/mbs-group-membership/:extGroupId",
s.HandleCreate5GMBSGroup,
},

{
"Create5GVNGroup",
strings.ToUpper("Put"),
"/5g-vn-groups/:extGroupId",
s.HandleCreate5GVNGroup,
},

{
"CreatePPDataEntry",
strings.ToUpper("Put"),
"/:ueId/pp-data-store/:afInstanceId",
s.HandleCreatePPDataEntry,
},

{
"Delete5GMBSGroup",
strings.ToUpper("Delete"),
"/mbs-group-membership/:extGroupId",
s.HandleDelete5GMBSGroup,
},

{
"Delete5GVNGroup",
strings.ToUpper("Delete"),
"/5g-vn-groups/:extGroupId",
s.HandleDelete5GVNGroup,
},

{
"DeletePPDataEntry",
strings.ToUpper("Delete"),
"/:ueId/pp-data-store/:afInstanceId",
s.HandleDeletePPDataEntry,
},

{
"Get5GMBSGroup",
strings.ToUpper("Get"),
"/mbs-group-membership/:extGroupId",
s.HandleGet5GMBSGroup,
},

{
"Get5GVNGroup",
strings.ToUpper("Get"),
"/5g-vn-groups/:extGroupId",
s.HandleGet5GVNGroup,
},

{
"GetPPDataEntry",
strings.ToUpper("Get"),
"/:ueId/pp-data-store/:afInstanceId",
s.HandleGetPPDataEntry,
},

{
"Modify5GMBSGroup",
strings.ToUpper("Patch"),
"/mbs-group-membership/:extGroupId",
s.HandleModify5GMBSGroup,
},

{
"Modify5GVNGroup",
strings.ToUpper("Patch"),
"/5g-vn-groups/:extGroupId",
s.HandleModify5GVNGroup,
},
}
}

Expand Down Expand Up @@ -75,3 +152,47 @@ func (s *Server) HandleUpdate(c *gin.Context) {
// step 3: handle the message
s.Processor().UpdateProcedure(c, ppDataReq, gpsi)
}

func (s *Server) HandleCreate5GMBSGroup(c *gin.Context) {
c.JSON(http.StatusNotImplemented, gin.H{})
}

func (s *Server) HandleCreate5GVNGroup(c *gin.Context) {
c.JSON(http.StatusNotImplemented, gin.H{})
}

func (s *Server) HandleCreatePPDataEntry(c *gin.Context) {
c.JSON(http.StatusNotImplemented, gin.H{})
}

func (s *Server) HandleDelete5GMBSGroup(c *gin.Context) {
c.JSON(http.StatusNotImplemented, gin.H{})
}

func (s *Server) HandleDelete5GVNGroup(c *gin.Context) {
c.JSON(http.StatusNotImplemented, gin.H{})
}

func (s *Server) HandleDeletePPDataEntry(c *gin.Context) {
c.JSON(http.StatusNotImplemented, gin.H{})
}

func (s *Server) HandleGet5GMBSGroup(c *gin.Context) {
c.JSON(http.StatusNotImplemented, gin.H{})
}

func (s *Server) HandleGet5GVNGroup(c *gin.Context) {
c.JSON(http.StatusNotImplemented, gin.H{})
}

func (s *Server) HandleGetPPDataEntry(c *gin.Context) {
c.JSON(http.StatusNotImplemented, gin.H{})
}

func (s *Server) HandleModify5GMBSGroup(c *gin.Context) {
c.JSON(http.StatusNotImplemented, gin.H{})
}

func (s *Server) HandleModify5GVNGroup(c *gin.Context) {
c.JSON(http.StatusNotImplemented, gin.H{})
}
177 changes: 176 additions & 1 deletion internal/sbi/api_subscriberdatamanagement.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,70 @@ func (s *Server) HandleGetIdTranslationResult(c *gin.Context) {
s.Processor().GetIdTranslationResultProcedure(c, gpsi)
}

func (s *Server) HandleGetMultipleIdentifiers(c *gin.Context) {
c.JSON(http.StatusNotImplemented, gin.H{})
}

func (s *Server) HandleGetGroupIdentifiers(c *gin.Context) {
c.JSON(http.StatusNotImplemented, gin.H{})
}

func (s *Server) HandleGetLcsBcaData(c *gin.Context) {
c.JSON(http.StatusNotImplemented, gin.H{})
}

func (s *Server) HandleGetLcsMoData(c *gin.Context) {
c.JSON(http.StatusNotImplemented, gin.H{})
}

func (s *Server) HandleGetLcsPrivacyData(c *gin.Context) {
c.JSON(http.StatusNotImplemented, gin.H{})
}

func (s *Server) HandleGetMbsData(c *gin.Context) {
c.JSON(http.StatusNotImplemented, gin.H{})
}

func (s *Server) HandleGetProseData(c *gin.Context) {
c.JSON(http.StatusNotImplemented, gin.H{})
}

func (s *Server) HandleGetUcData(c *gin.Context) {
c.JSON(http.StatusNotImplemented, gin.H{})
}

func (s *Server) HandleGetUeCtxInAmfData(c *gin.Context) {
c.JSON(http.StatusNotImplemented, gin.H{})
}

func (s *Server) HandleGetV2xData(c *gin.Context) {
c.JSON(http.StatusNotImplemented, gin.H{})
}

func (s *Server) HandleGetIndividualSharedData(c *gin.Context) {
c.JSON(http.StatusNotImplemented, gin.H{})
}

func (s *Server) HandleCAGAck(c *gin.Context) {
c.JSON(http.StatusNotImplemented, gin.H{})
}

func (s *Server) HandleGetEcrData(c *gin.Context) {
c.JSON(http.StatusNotImplemented, gin.H{})
}

func (s *Server) HandleSNSSAIsAck(c *gin.Context) {
c.JSON(http.StatusNotImplemented, gin.H{})
}

func (s *Server) HandleUpdateSORInfo(c *gin.Context) {
c.JSON(http.StatusNotImplemented, gin.H{})
}

func (s *Server) HandleUpuAck(c *gin.Context) {
c.JSON(http.StatusNotImplemented, gin.H{})
}

func (s *Server) OneLayerPathHandlerFunc(c *gin.Context) {
supi := c.Param("supi")
oneLayerPathRouter := s.getOneLayerRoutes()
Expand Down Expand Up @@ -419,10 +483,17 @@ 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
}

// for "/shared-data/:sharedDataId"
if supi == "shared-data" && strings.ToUpper("Get") == c.Request.Method {
s.HandleGetIndividualSharedData(c)
return
}

twoLayerPathRouter := s.getTwoLayerRoutes()
for _, route := range twoLayerPathRouter {
if strings.Contains(route.Pattern, op) && route.Method == c.Request.Method {
Expand All @@ -436,25 +507,59 @@ func (s *Server) TwoLayerPathHandlerFunc(c *gin.Context) {

func (s *Server) ThreeLayerPathHandlerFunc(c *gin.Context) {
op := c.Param("subscriptionId")
thirdLayer := c.Param("thirdLayer")

// 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)
return
}

// for "/:supi/am-data/sor-ack"
if op == "am-data" && strings.ToUpper("Put") == c.Request.Method {
if op == "am-data" && strings.ToUpper("Put") == c.Request.Method && thirdLayer == "sor-ack" {
s.HandleInfo(c)
return
}

// for "/:supi/am-data/cag-ack"
if op == "am-data" && strings.ToUpper("Put") == c.Request.Method && thirdLayer == "cag-ack" {
s.HandleCAGAck(c)
return
}

// for "/:supi/am-data/ecr-data"
if op == "am-data" && strings.ToUpper("Get") == c.Request.Method && thirdLayer == "ecr-data" {
s.HandleGetEcrData(c)
return
}

// for "/:supi/am-data/subscribed-snssais-ack"
if op == "am-data" && strings.ToUpper("Put") == c.Request.Method &&
thirdLayer == "subscribed-snssais-ack" {
s.HandleSNSSAIsAck(c)
return
}

// for "/:supi/am-data/update-sor"
if op == "am-data" && strings.ToUpper("Post") == c.Request.Method && thirdLayer == "update-sor" {
s.HandleUpdateSORInfo(c)
return
}

// for "/:supi/am-data/upu-ack"
if op == "am-data" && strings.ToUpper("Put") == c.Request.Method && thirdLayer == "upu-ack" {
s.HandleUpuAck(c)
return
}

// 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 Expand Up @@ -486,6 +591,13 @@ func (s *Server) getOneLayerRoutes() []Route {
"/shared-data-subscriptions",
s.HandleSubscribeToSharedData,
},

{
"GetMultipleIdentifiers",
strings.ToUpper("Get"),
"/multiple-identifiers",
s.HandleGetMultipleIdentifiers,
},
}
}

Expand Down Expand Up @@ -560,5 +672,68 @@ func (s *Server) getTwoLayerRoutes() []Route {
"/:supi/ue-context-in-smsf-data",
s.HandleGetUeContextInSmsfData,
},

{
"GetGroupIdentifiers",
strings.ToUpper("Get"),
"/group-data/group-identifiers",
s.HandleGetGroupIdentifiers,
},

{
"GetLcsBcaData",
strings.ToUpper("Get"),
"/:supi/lcs-bca-data",
s.HandleGetLcsBcaData,
},

{
"GetLcsMoData",
strings.ToUpper("Get"),
"/:supi/lcs-mo-data",
s.HandleGetLcsMoData,
},

{
"GetLcsPrivacyData",
strings.ToUpper("Get"),
"/:ueId/lcs-privacy-data",
s.HandleGetLcsPrivacyData,
},

{
"GetMbsData",
strings.ToUpper("Get"),
"/:supi/5mbs-data",
s.HandleGetMbsData,
},

{
"GetProseData",
strings.ToUpper("Get"),
"/:supi/prose-data",
s.HandleGetProseData,
},

{
"GetUcData",
strings.ToUpper("Get"),
"/:supi/uc-data",
s.HandleGetUcData,
},

{
"GetUeCtxInAmfData",
strings.ToUpper("Get"),
"/:supi/ue-context-in-amf-data",
s.HandleGetUeCtxInAmfData,
},

{
"GetV2xData",
strings.ToUpper("Get"),
"/:supi/v2x-data",
s.HandleGetV2xData,
},
}
}
Loading

0 comments on commit fc69b8a

Please sign in to comment.