Skip to content

Commit

Permalink
fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
brianchennn committed Aug 23, 2023
1 parent 3f2e401 commit f6585ad
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 15 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d
github.com/evanphx/json-patch v0.5.2
github.com/free5gc/openapi v1.0.6
github.com/free5gc/util v1.0.5-0.20230816143033-e726373b7087
github.com/free5gc/util v1.0.5-0.20230823103219-e511c4fd20ef
github.com/gin-gonic/gin v1.9.0
github.com/google/uuid v1.3.0
github.com/mitchellh/mapstructure v1.4.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ github.com/evanphx/json-patch v0.5.2 h1:xVCHIVMUu1wtM/VkR9jVZ45N3FhZfYMMYGorLCR8
github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ=
github.com/free5gc/openapi v1.0.6 h1:ytRjU/YZRI8UhKKyfajXSyGB6s1YDFkJ1weeAGJ8LXw=
github.com/free5gc/openapi v1.0.6/go.mod h1:iw/N0E+FlX44EEx24IBi2EdZW8v+bkj3ETWPGnlK9DI=
github.com/free5gc/util v1.0.5-0.20230816143033-e726373b7087 h1:gkY/Njn/OWQMITQfZ1q8QjRLN4ElDEQYAQWtV+MpYwc=
github.com/free5gc/util v1.0.5-0.20230816143033-e726373b7087/go.mod h1:l2Jrml4vojDomW5jdDJhIS60KdbrE9uPYhyAq/7OnF4=
github.com/free5gc/util v1.0.5-0.20230823103219-e511c4fd20ef h1:ne0EMnst7wbLoaY2Uvn/2Kvp/KkXKMQJcaIJQKFe+a4=
github.com/free5gc/util v1.0.5-0.20230823103219-e511c4fd20ef/go.mod h1:l2Jrml4vojDomW5jdDJhIS60KdbrE9uPYhyAq/7OnF4=
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
github.com/gin-gonic/gin v1.9.0 h1:OjyFBKICoexlu99ctXNR2gg+c5pKrKMuyjgARg9qeY8=
Expand Down
39 changes: 27 additions & 12 deletions internal/sbi/producer/data_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -1451,23 +1451,38 @@ func PolicyDataUesUeIdSmDataGetProcedure(collName string, ueId string, snssai mo
) (*models.SmPolicyData, *models.ProblemDetails) {
filter := bson.M{"ueId": ueId}

smPolicyData, pd := getDataFromDBWithArg(collName, filter, 2)
smPolicyData, pd := getDataFromDBWithArg(collName, filter, mongoapi.COLLATION_STRENGTH_IGNORE_CASE)
if pd != nil {
return nil, pd
}

hex_snssai := util.SnssaiModelsToHex(snssai)
found := false
for snssai_str, val := range smPolicyData["smPolicySnssaiData"].(map[string]interface{}) {
if strings.EqualFold(snssai_str, hex_snssai) {
for _, dnn_map := range val.(map[string]interface{})["smPolicyDnnData"].(map[string]interface{}) {
for _, dnn_string := range dnn_map.(map[string]interface{}) {
if strings.Compare(dnn_string.(string), util.EscapeDnn(dnn)) == 0 {
found = true
}
}
smPolicySnssaiDatas, ok := smPolicyData["smPolicySnssaiData"].(map[string]interface{})
if !ok {
return nil, util.ProblemDetailsNotFound("DATA_NOT_FOUND")
}
for snssai, v := range smPolicySnssaiDatas {
if !strings.EqualFold(snssai, hex_snssai) {
continue
}
smPolicySnssaiData, ok := v.(map[string]interface{})
if !ok {
break
}
smPolicyDnnDatas, ok := smPolicySnssaiData["smPolicyDnnData"].(map[string]interface{})
if !ok {
break
}
for dnn := range smPolicyDnnDatas {
if strings.EqualFold(dnn, util.EscapeDnn(dnn)) {
found = true
break
}
}
if found {
break
}
}
if !found {
return nil, util.ProblemDetailsNotFound("DATA_NOT_FOUND")
Expand Down Expand Up @@ -2426,7 +2441,7 @@ func QueryProvisionedDataProcedure(ueId string, servingPlmnId string,

collName = "subscriptionData.provisionedData.smData"
filter = bson.M{"ueId": ueId, "servingPlmnId": servingPlmnId}
sessionManagementSubscriptionDatas, err := mongoapi.RestfulAPIGetManyWithArg(collName, filter, 2)
sessionManagementSubscriptionDatas, err := mongoapi.RestfulAPIGetManyWithArg(collName, filter, mongoapi.COLLATION_STRENGTH_IGNORE_CASE)

Check failure on line 2444 in internal/sbi/producer/data_repository.go

View workflow job for this annotation

GitHub Actions / lint (1.17)

line is 136 characters (lll)
if err != nil {
logger.DataRepoLog.Errorf("QueryProvisionedDataProcedure get sessionManagementSubscriptionDatas err: %+v", err)
return nil, openapi.ProblemDetailsSystemFailure(err.Error())
Expand Down Expand Up @@ -2800,7 +2815,7 @@ func QuerySmDataProcedure(collName string, ueId string, servingPlmnId string,
filter["dnnConfigurations."+dnnKey] = bson.M{"$exists": true}
}

sessionManagementSubscriptionDatas, err := mongoapi.RestfulAPIGetManyWithArg(collName, filter, 2)
sessionManagementSubscriptionDatas, err := mongoapi.RestfulAPIGetManyWithArg(collName, filter, mongoapi.COLLATION_STRENGTH_IGNORE_CASE)

Check failure on line 2818 in internal/sbi/producer/data_repository.go

View workflow job for this annotation

GitHub Actions / lint (1.17)

line is 136 characters (lll)
if err != nil {
logger.DataRepoLog.Errorf("QuerySmDataProcedure err: %+v", err)
return nil
Expand Down Expand Up @@ -2937,7 +2952,7 @@ func HandleQuerySmfRegList(request *httpwrapper.Request) *httpwrapper.Response {

func QuerySmfRegListProcedure(collName string, ueId string) *[]map[string]interface{} {
filter := bson.M{"ueId": ueId}
smfRegList, err := mongoapi.RestfulAPIGetManyWithArg(collName, filter, 2)
smfRegList, err := mongoapi.RestfulAPIGetManyWithArg(collName, filter, mongoapi.COLLATION_STRENGTH_IGNORE_CASE)
if err != nil {
logger.DataRepoLog.Errorf("QuerySmfRegListProcedure err: %+v", err)
return nil
Expand Down

0 comments on commit f6585ad

Please sign in to comment.