-
Notifications
You must be signed in to change notification settings - Fork 0
/
api_retrieval_of_multiple_data_sets.go
45 lines (39 loc) · 1.19 KB
/
api_retrieval_of_multiple_data_sets.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* Nudm_SDM
*
* Nudm Subscriber Data Management Service
*
* API version: 2.0.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package subscriberdatamanagement
import (
"github.com/nycu-ucr/gonet/http"
"github.com/nycu-ucr/gin"
"github.com/nycu-ucr/http_wrapper"
"github.com/nycu-ucr/openapi"
"github.com/nycu-ucr/openapi/models"
"github.com/nycu-ucr/udm/logger"
"github.com/nycu-ucr/udm/producer"
)
// GetSupi - retrieve multiple data sets
func HTTPGetSupi(c *gin.Context) {
req := http_wrapper.NewRequest(c.Request, nil)
req.Params["supi"] = c.Params.ByName("supi")
req.Query.Set("plmn-id", c.Query("plmn-id"))
req.Query.Set("dataset-names", c.Query("dataset-names"))
req.Query.Set("supported-features", c.Query("supported-features"))
rsp := producer.HandleGetSupiRequest(req)
responseBody, err := openapi.Serialize(rsp.Body, "application/json")
if err != nil {
logger.SdmLog.Errorln(err)
problemDetails := models.ProblemDetails{
Status: http.StatusInternalServerError,
Cause: "SYSTEM_FAILURE",
Detail: err.Error(),
}
c.JSON(http.StatusInternalServerError, problemDetails)
} else {
c.Data(rsp.Status, "application/json", responseBody)
}
}