Skip to content

Commit

Permalink
Fix: fix compile and linter error
Browse files Browse the repository at this point in the history
  • Loading branch information
andy89923 committed Jan 3, 2024
1 parent fec279e commit 5d2a393
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 57 deletions.
23 changes: 18 additions & 5 deletions backend/WebUI/api_webui.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const (
tenantDataColl = "tenantData"
identityDataColl = "subscriptionData.identityData"

queryStrength = 2
// queryStrength = 2
)

var jwtKey = "" // for generating JWT
Expand Down Expand Up @@ -1391,10 +1391,19 @@ func sendRechargeNotification(ueId string, rg int32) {
if err != nil {
logger.ProcLog.Error(err)
}
defer func() {
if err = req.Body.Close(); err != nil {
logger.ProcLog.Error(err)
}
}()
req.Header.Add("Content-Type", "application/json")

if _, err = http.DefaultClient.Do(req); err != nil {
logger.ProcLog.Errorf("Send Charging Notification err: %+v", err)
resp, err1 := http.DefaultClient.Do(req)
if err != nil {
logger.ProcLog.Errorf("Send Charging Notification err: %+v", err1)
}
if err = resp.Body.Close(); err != nil {
logger.ProcLog.Error(err)
}
}

Expand Down Expand Up @@ -1962,7 +1971,8 @@ func parseCDR(supi string) (map[int64]RatingGroupDataUsage, error) {
du := dataUsage[rg]

// logger.BillingLog.Warnln("rg:", rg)
// logger.BillingLog.Warnln("SD:", string(chargingRecord.PDUSessionChargingInformation.NetworkSliceInstanceID.SD.Value))
// logger.BillingLog.Warnln("SD:",
// string(chargingRecord.PDUSessionChargingInformation.NetworkSliceInstanceID.SD.Value))

du.Snssai = fmt.Sprintf("%02d", chargingRecord.PDUSessionChargingInformation.NetworkSliceInstanceID.SST.Value) +
string(chargingRecord.PDUSessionChargingInformation.NetworkSliceInstanceID.SD.Value)
Expand Down Expand Up @@ -2050,7 +2060,10 @@ func GetChargingRecord(c *gin.Context) {
du.Dnn = chargingData.Dnn
du.Supi = supi
du.Filter = chargingData.Filter
tmpInt, _ := strconv.Atoi(chargingData.Quota)
tmpInt, err1 := strconv.Atoi(chargingData.Quota)
if err1 != nil {
logger.BillingLog.Error("Quota strconv: ", err1)
}
du.QuotaLeft = int64(tmpInt)

ratingGroupDataUsages[rg] = du
Expand Down
1 change: 0 additions & 1 deletion backend/factory/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ type Configuration struct {
Mongodb *Mongodb `yaml:"mongodb" valid:"required"`
NrfUri string `yaml:"nrfUri" valid:"required"`
BillingServer *BillingServer `yaml:"billingServer,omitempty" valid:"required"`
NrfUri string `yaml:"nrfUri" valid:"required"`
}

type Logger struct {
Expand Down
15 changes: 8 additions & 7 deletions frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2124,6 +2124,11 @@
resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz#533f36457a25814cf1df6488523ad547d784a99f"
integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==

"@babel/helper-validator-identifier@^7.22.20":
version "7.22.20"
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0"
integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==

"@babel/helper-validator-identifier@^7.22.5":
version "7.22.5"
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz#9544ef6a33999343c8740fa51350f30eeaaaf193"
Expand Down Expand Up @@ -3024,7 +3029,7 @@
debug "^4.1.0"
globals "^11.1.0"

"@babel/types@^7.0.0", "@babel/types@^7.12.6", "@babel/types@^7.20.7", "@babel/types@^7.22.10", "@babel/types@^7.22.11", "@babel/types@^7.22.5", "@babel/types@^7.3.3", "@babel/types@^7.4.4":
"@babel/types@^7.0.0", "@babel/types@^7.12.6", "@babel/types@^7.20.7", "@babel/types@^7.22.10", "@babel/types@^7.22.11", "@babel/types@^7.3.3", "@babel/types@^7.4.4":
version "7.22.11"
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.22.11.tgz#0e65a6a1d4d9cbaa892b2213f6159485fe632ea2"
integrity sha512-siazHiGuZRz9aB9NpHy9GOs9xiQPKnMzgdr493iI1M67vRXpnEq8ZOOKzezC5q7zwuQ6sDhdSp4SD9ixKSqKZg==
Expand All @@ -3033,7 +3038,7 @@
"@babel/helper-validator-identifier" "^7.22.5"
to-fast-properties "^2.0.0"

"@babel/types@^7.22.15", "@babel/types@^7.22.5", "@babel/types@^7.23.0":
"@babel/types@^7.22.5":
version "7.23.0"
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.0.tgz#8c1f020c9df0e737e4e247c0619f58c68458aaeb"
integrity sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==
Expand Down Expand Up @@ -6242,7 +6247,7 @@ case-sensitive-paths-webpack-plugin@^2.4.0:
resolved "https://registry.yarnpkg.com/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.4.0.tgz#db64066c6422eed2e08cc14b986ca43796dbc6d4"
integrity sha512-roIFONhcxog0JSSWbvVAh3OocukmSgpqOH6YpMkCvav/ySIV3JKg4Dc8vYtQjYi/UxpNE36r/9v+VqTQqgkYmw==

chalk@^2.0.0, chalk@^2.4.1, chalk@^2.4.2:
chalk@^2.4.1, chalk@^2.4.2:
version "2.4.2"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
Expand Down Expand Up @@ -13541,10 +13546,6 @@ which@^2.0.1:
dependencies:
isexe "^2.0.0"

word-wrap@^1.2.3, word-wrap@~1.2.3:
version "1.2.5"
resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34"
integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==
workbox-background-sync@6.6.1:
version "6.6.1"
resolved "https://registry.yarnpkg.com/workbox-background-sync/-/workbox-background-sync-6.6.1.tgz#08d603a33717ce663e718c30cc336f74909aff2f"
Expand Down
6 changes: 0 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,10 @@ require (
require (
cloud.google.com/go/compute/metadata v0.2.3 // indirect
github.com/bytedance/sonic v1.9.1 // indirect
github.com/bytedance/sonic v1.9.1 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/dropbox/dropbox-sdk-go-unofficial v5.6.0+incompatible // indirect
github.com/evanphx/json-patch v0.5.2 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/fclairamb/afero-dropbox v0.1.0 // indirect
github.com/fclairamb/afero-gdrive v0.3.0 // indirect
github.com/fclairamb/afero-s3 v0.3.1 // indirect
Expand All @@ -41,8 +39,6 @@ require (
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.14.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/go-playground/validator/v10 v10.14.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.3 // indirect
Expand All @@ -61,7 +57,6 @@ require (
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/pkg/sftp v1.13.5 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/tidwall/gjson v1.14.4 // indirect
Expand All @@ -71,7 +66,6 @@ require (
github.com/tim-ywliu/nested-logrus-formatter v1.3.2 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
github.com/xdg-go/scram v1.1.1 // indirect
github.com/xdg-go/stringprep v1.0.3 // indirect
Expand Down
Loading

0 comments on commit 5d2a393

Please sign in to comment.