fix: ims user tag 0/1: VoIP/VoLTE

This commit is contained in:
zhangsz
2025-04-10 21:16:54 +08:00
parent 8913970d01
commit 63433e6e0e
10 changed files with 90 additions and 56 deletions

View File

@@ -115,7 +115,7 @@ func (s *IMSUserController) Add(c *gin.Context) {
var body model.IMSUser
err := c.ShouldBindBodyWith(&body, binding.JSON)
if err != nil || (len(body.IMSI) < model.IMSI_MAX_LENGTH && body.VoLTE == model.TAG_VoLTE) {
if err != nil || (len(body.IMSI) < model.IMSI_MAX_LENGTH && body.Tag == model.TAG_VoLTE) {
c.JSON(400, result.CodeMsg(400, i18n.TKey(language, "app.common.err400")))
return
}
@@ -162,7 +162,7 @@ func (s *IMSUserController) Adds(c *gin.Context) {
var body model.IMSUser
err := c.ShouldBindBodyWith(&body, binding.JSON)
if err != nil || (len(body.IMSI) < model.IMSI_MAX_LENGTH && body.VoLTE == model.TAG_VoLTE) {
if err != nil || (len(body.IMSI) < model.IMSI_MAX_LENGTH && body.Tag == model.TAG_VoLTE) {
c.JSON(400, result.CodeMsg(400, i18n.TKey(language, "app.common.err400")))
return
}
@@ -381,9 +381,9 @@ func (s *IMSUserController) Export(c *gin.Context) {
if fileType == "csv" {
// 转换数据
data := [][]string{}
data = append(data, []string{"IMSI", "MSISDN", "VoLTE", "VNI"})
data = append(data, []string{"IMSI", "MSISDN", "Tag", "VNI"})
for _, v := range rows {
data = append(data, []string{v.IMSI, v.MSISDN, v.VoLTE, v.VNI})
data = append(data, []string{v.IMSI, v.MSISDN, v.Tag.String(), v.VNI})
}
// 输出到文件
if err := file.WriterFileCSV(data, filePath); err != nil {
@@ -396,7 +396,7 @@ func (s *IMSUserController) Export(c *gin.Context) {
// 转换数据
data := [][]string{}
for _, v := range rows {
data = append(data, []string{v.IMSI, v.MSISDN, v.VoLTE, v.VNI})
data = append(data, []string{v.IMSI, v.MSISDN, v.Tag.String(), v.VNI})
}
// 输出到文件
if err := file.WriterFileTXT(data, ",", filePath); err != nil {