From 05d94572f4f2acd8fb4f85f5827a493a8015430d Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Tue, 28 Nov 2023 09:37:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20UDM=E7=94=A8=E6=88=B7=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=93=8D=E5=BA=94=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/network_element/controller/udm_auth.go | 14 +++++++------- src/modules/network_element/controller/udm_sub.go | 14 +++++++------- .../network_element/service/udm_auth.impl.go | 6 ++---- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/src/modules/network_element/controller/udm_auth.go b/src/modules/network_element/controller/udm_auth.go index a3e55965..d1acc52e 100644 --- a/src/modules/network_element/controller/udm_auth.go +++ b/src/modules/network_element/controller/udm_auth.go @@ -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 } diff --git a/src/modules/network_element/controller/udm_sub.go b/src/modules/network_element/controller/udm_sub.go index dce70634..df738622 100644 --- a/src/modules/network_element/controller/udm_sub.go +++ b/src/modules/network_element/controller/udm_sub.go @@ -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 } diff --git a/src/modules/network_element/service/udm_auth.impl.go b/src/modules/network_element/service/udm_auth.impl.go index 7d6cd519..ed7cc4ab 100644 --- a/src/modules/network_element/service/udm_auth.impl.go +++ b/src/modules/network_element/service/udm_auth.impl.go @@ -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)