fix: ue ims user

This commit is contained in:
zhangsz
2025-04-10 19:53:04 +08:00
parent a00a7da016
commit 8913970d01
4 changed files with 23 additions and 17 deletions

View File

@@ -6,6 +6,8 @@ import (
"strings"
"time"
"be.ems/features/ue/model"
"be.ems/features/ue/service"
"be.ems/src/framework/constants/uploadsubpath"
"be.ems/src/framework/i18n"
"be.ems/src/framework/telnet"
@@ -14,24 +16,22 @@ import (
"be.ems/src/framework/utils/parse"
"be.ems/src/framework/vo/result"
neService "be.ems/src/modules/network_element/service"
"be.ems/features/ue/service"
"be.ems/features/ue/model"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding"
)
// 实例化控制层 IMSUserController 结构体
var NewIMSUserController = &IMSUserController{
imsUserService: service.NewIMSUserService,
neInfoService: neService.NewNeInfo,
imsUserService: service.NewIMSUserService,
neInfoService: neService.NewNeInfo,
}
// IMS用户信息 控制层处理
//
// @Description IMS用户信息 控制层处理
type IMSUserController struct {
imsUserService *service.IMSUserService // IMS User信息服务
neInfoService *neService.NeInfo // 网元信息服务
imsUserService *service.IMSUserService // IMS User信息服务
neInfoService *neService.NeInfo // 网元信息服务
}
func (s *IMSUserController) ResetData(c *gin.Context) {
@@ -46,7 +46,6 @@ func (s *IMSUserController) ResetData(c *gin.Context) {
c.JSON(200, result.OkData(data))
}
func (s *IMSUserController) List(c *gin.Context) {
querys := ctx.QueryMap(c)
// querys["userName"] = ctx.LoginUserToUserName(c)
@@ -116,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 {
if err != nil || (len(body.IMSI) < model.IMSI_MAX_LENGTH && body.VoLTE == model.TAG_VoLTE) {
c.JSON(400, result.CodeMsg(400, i18n.TKey(language, "app.common.err400")))
return
}
@@ -163,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 {
if err != nil || (len(body.IMSI) < model.IMSI_MAX_LENGTH && body.VoLTE == model.TAG_VoLTE) {
c.JSON(400, result.CodeMsg(400, i18n.TKey(language, "app.common.err400")))
return
}
@@ -376,7 +375,7 @@ func (s *IMSUserController) Export(c *gin.Context) {
}
// 文件名
fileName := fmt.Sprintf("udm_volte_user_export_%s_%d.%s", neId, time.Now().UnixMilli(), fileType)
fileName := fmt.Sprintf("u_ims_user_export_%s_%d.%s", neId, time.Now().UnixMilli(), fileType)
filePath := filepath.Join(file.ParseUploadFileDir(uploadsubpath.EXPORT), fileName)
if fileType == "csv" {