fix: 网元模块(查询网元,UDM用户信息)

This commit is contained in:
TsMask
2023-11-20 18:49:31 +08:00
parent 03b404ed18
commit 0c3cd1b31f
21 changed files with 2225 additions and 68 deletions

View File

@@ -0,0 +1,42 @@
package controller
import (
"ems.agt/src/framework/i18n"
"ems.agt/src/framework/utils/ctx"
"ems.agt/src/framework/vo/result"
neService "ems.agt/src/modules/network_element/service"
"github.com/gin-gonic/gin"
)
// 实例化控制层 NeInfoController 结构体
var NewNeInfo = &NeInfoController{
neInfoService: neService.NewNeInfoImpl,
}
// 网元信息请求
//
// PATH /
type NeInfoController struct {
// 网元信息服务
neInfoService neService.INeInfo
}
// 网元neType和neID查询
//
// GET /info
func (s *NeInfoController) NeTypeAndID(c *gin.Context) {
language := ctx.AcceptLanguage(c)
neType := c.Query("neType")
neId := c.Query("neId")
if neType == "" || neId == "" {
c.JSON(400, result.CodeMsg(400, i18n.TKey(language, "app.common.err400")))
return
}
neInfo := s.neInfoService.SelectNeInfoByNeTypeAndNeID(neType, neId)
if neInfo.NeId != neId || neInfo.IP == "" {
c.JSON(200, result.OkData(i18n.TKey(language, "app.common.noNEInfo")))
return
}
c.JSON(200, result.OkData(neInfo))
}