fix: UDM用户数据响应信息

This commit is contained in:
TsMask
2023-11-28 09:37:46 +08:00
parent 08b4174b83
commit 05d94572f4
3 changed files with 16 additions and 18 deletions

View File

@@ -76,7 +76,7 @@ func (s *UDMAuthController) Info(c *gin.Context) {
// 查询网元获取IP
neInfo := s.neInfoService.SelectNeInfoByNeTypeAndNeID("UDM", neId)
if neInfo.NeId != neId || neInfo.IP == "" {
c.JSON(200, result.OkData(i18n.TKey(language, "app.common.noNEInfo")))
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
return
}
@@ -134,7 +134,7 @@ func (s *UDMAuthController) Add(c *gin.Context) {
// 查询网元获取IP
neInfo := s.neInfoService.SelectNeInfoByNeTypeAndNeID("UDM", neId)
if neInfo.NeId != neId || neInfo.IP == "" {
c.JSON(200, result.OkData(i18n.TKey(language, "app.common.noNEInfo")))
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
return
}
@@ -177,7 +177,7 @@ func (s *UDMAuthController) Adds(c *gin.Context) {
// 查询网元获取IP
neInfo := s.neInfoService.SelectNeInfoByNeTypeAndNeID("UDM", neId)
if neInfo.NeId != neId || neInfo.IP == "" {
c.JSON(200, result.OkData(i18n.TKey(language, "app.common.noNEInfo")))
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
return
}
@@ -219,7 +219,7 @@ func (s *UDMAuthController) Edit(c *gin.Context) {
// 查询网元获取IP
neInfo := s.neInfoService.SelectNeInfoByNeTypeAndNeID("UDM", neId)
if neInfo.NeId != neId || neInfo.IP == "" {
c.JSON(200, result.OkData(i18n.TKey(language, "app.common.noNEInfo")))
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
return
}
@@ -268,7 +268,7 @@ func (s *UDMAuthController) Remove(c *gin.Context) {
// 查询网元获取IP
neInfo := s.neInfoService.SelectNeInfoByNeTypeAndNeID("UDM", neId)
if neInfo.NeId != neId || neInfo.IP == "" {
c.JSON(200, result.OkData(i18n.TKey(language, "app.common.noNEInfo")))
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
return
}
@@ -305,7 +305,7 @@ func (s *UDMAuthController) Removes(c *gin.Context) {
// 查询网元获取IP
neInfo := s.neInfoService.SelectNeInfoByNeTypeAndNeID("UDM", neId)
if neInfo.NeId != neId || neInfo.IP == "" {
c.JSON(200, result.OkData(i18n.TKey(language, "app.common.noNEInfo")))
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
return
}
@@ -414,7 +414,7 @@ func (s *UDMAuthController) Import(c *gin.Context) {
// 查询网元获取IP
neInfo := s.neInfoService.SelectNeInfoByNeTypeAndNeID("UDM", neId)
if neInfo.NeId != neId || neInfo.IP == "" {
c.JSON(200, result.OkData(i18n.TKey(language, "app.common.noNEInfo")))
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
return
}

View File

@@ -77,7 +77,7 @@ func (s *UDMSubController) Info(c *gin.Context) {
// 查询网元获取IP
neInfo := s.neInfoService.SelectNeInfoByNeTypeAndNeID("UDM", neId)
if neInfo.NeId != neId || neInfo.IP == "" {
c.JSON(200, result.OkData(i18n.TKey(language, "app.common.noNEInfo")))
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
return
}
@@ -158,7 +158,7 @@ func (s *UDMSubController) Add(c *gin.Context) {
// 查询网元获取IP
neInfo := s.neInfoService.SelectNeInfoByNeTypeAndNeID("UDM", neId)
if neInfo.NeId != neId || neInfo.IP == "" {
c.JSON(200, result.OkData(i18n.TKey(language, "app.common.noNEInfo")))
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
return
}
@@ -206,7 +206,7 @@ func (s *UDMSubController) Adds(c *gin.Context) {
// 查询网元获取IP
neInfo := s.neInfoService.SelectNeInfoByNeTypeAndNeID("UDM", neId)
if neInfo.NeId != neId || neInfo.IP == "" {
c.JSON(200, result.OkData(i18n.TKey(language, "app.common.noNEInfo")))
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
return
}
@@ -253,7 +253,7 @@ func (s *UDMSubController) Edit(c *gin.Context) {
// 查询网元获取IP
neInfo := s.neInfoService.SelectNeInfoByNeTypeAndNeID("UDM", neId)
if neInfo.NeId != neId || neInfo.IP == "" {
c.JSON(200, result.OkData(i18n.TKey(language, "app.common.noNEInfo")))
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
return
}
@@ -344,7 +344,7 @@ func (s *UDMSubController) Remove(c *gin.Context) {
// 查询网元获取IP
neInfo := s.neInfoService.SelectNeInfoByNeTypeAndNeID("UDM", neId)
if neInfo.NeId != neId || neInfo.IP == "" {
c.JSON(200, result.OkData(i18n.TKey(language, "app.common.noNEInfo")))
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
return
}
@@ -381,7 +381,7 @@ func (s *UDMSubController) Removes(c *gin.Context) {
// 查询网元获取IP
neInfo := s.neInfoService.SelectNeInfoByNeTypeAndNeID("UDM", neId)
if neInfo.NeId != neId || neInfo.IP == "" {
c.JSON(200, result.OkData(i18n.TKey(language, "app.common.noNEInfo")))
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
return
}
@@ -492,7 +492,7 @@ func (s *UDMSubController) Import(c *gin.Context) {
// 查询网元获取IP
neInfo := s.neInfoService.SelectNeInfoByNeTypeAndNeID("UDM", neId)
if neInfo.NeId != neId || neInfo.IP == "" {
c.JSON(200, result.OkData(i18n.TKey(language, "app.common.noNEInfo")))
c.JSON(200, result.ErrMsg(i18n.TKey(language, "app.common.noNEInfo")))
return
}

View File

@@ -40,10 +40,8 @@ func (r *UDMAuthImpl) authDataByRedis(imsi, neID string) []model.UDMAuth {
continue
}
status := "0"
if _, ok := m["auth_success"]; ok {
status = "1"
}
status := "1" // 默认给1
amf := ""
if v, ok := m["amf"]; ok {
amf = strings.Replace(v, "\r\n", "", 1)