fix: not reload for batch add & delete failed imsi length < 15
This commit is contained in:
@@ -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"
|
||||
)
|
||||
|
||||
// 实例化控制层 VoIPAuthController 结构体
|
||||
var NewVoIPAuthController = &VoIPAuthController{
|
||||
voipAuthService: service.NewVoIPAuthService,
|
||||
neInfoService: neService.NewNeInfo,
|
||||
voipAuthService: service.NewVoIPAuthService,
|
||||
neInfoService: neService.NewNeInfo,
|
||||
}
|
||||
|
||||
// IMS用户信息 控制层处理
|
||||
//
|
||||
// @Description IMS用户信息 控制层处理
|
||||
type VoIPAuthController struct {
|
||||
voipAuthService *service.VoIPAuthService // VoIP Auth信息服务
|
||||
neInfoService *neService.NeInfo // 网元信息服务
|
||||
voipAuthService *service.VoIPAuthService // VoIP Auth信息服务
|
||||
neInfoService *neService.NeInfo // 网元信息服务
|
||||
}
|
||||
|
||||
func (s *VoIPAuthController) ResetData(c *gin.Context) {
|
||||
@@ -46,7 +46,6 @@ func (s *VoIPAuthController) ResetData(c *gin.Context) {
|
||||
c.JSON(200, result.OkData(data))
|
||||
}
|
||||
|
||||
|
||||
func (s *VoIPAuthController) List(c *gin.Context) {
|
||||
querys := ctx.QueryMap(c)
|
||||
// querys["userName"] = ctx.LoginUserToUserName(c)
|
||||
@@ -183,7 +182,7 @@ func (s *VoIPAuthController) Adds(c *gin.Context) {
|
||||
defer telnetClient.Close()
|
||||
|
||||
// 发送MML
|
||||
cmd := fmt.Sprintf("baa voip:start_username=%s,password=%s,sub_num=%s,",
|
||||
cmd := fmt.Sprintf("baa voip:start_username=%s,password=%s,sub_num=%s,",
|
||||
body.UserName, body.Password, num)
|
||||
cmd += s.voipAuthService.ParseCommandParams(body)
|
||||
data, err := telnet.ConvertToStr(telnetClient, cmd)
|
||||
@@ -191,7 +190,10 @@ func (s *VoIPAuthController) Adds(c *gin.Context) {
|
||||
c.JSON(200, result.ErrMsg(err.Error()))
|
||||
return
|
||||
}
|
||||
|
||||
// 命令ok时
|
||||
if strings.Contains(data, "ok") {
|
||||
s.voipAuthService.LoadData(neId, body.UserName, num)
|
||||
}
|
||||
c.JSON(200, result.OkData(data))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user