feat: 网元信息查询带主机信息查询函数

This commit is contained in:
TsMask
2024-03-01 19:01:08 +08:00
parent c09bd4dbf3
commit ec57024cca
5 changed files with 48 additions and 8 deletions

View File

@@ -140,7 +140,7 @@ func (s *NeInfoController) Info(c *gin.Context) {
return
}
neHost := s.neInfoService.SelectById(infoId)
neHost := s.neInfoService.SelectById(infoId, true)
if neHost.ID != infoId {
// 没有可访问网元信息数据!
c.JSON(200, result.ErrMsg(i18n.TKey(language, "neInfo.noData")))
@@ -193,6 +193,14 @@ func (s *NeInfoController) Add(c *gin.Context) {
return
}
// 下发网管配置信息给网元
_, err = neService.NeConfigOMC(body)
if err == nil {
body.Status = "1"
} else {
body.Status = "0"
}
insertId := s.neInfoService.Insert(body)
if insertId != "" {
c.JSON(200, result.Ok(nil))
@@ -223,13 +231,21 @@ func (s *NeInfoController) Edit(c *gin.Context) {
}
// 检查是否存在
neInfo := s.neInfoService.SelectById(body.ID)
neInfo := s.neInfoService.SelectById(body.ID, false)
if neInfo.ID != body.ID {
// 没有可访问网元信息数据!
c.JSON(200, result.ErrMsg(i18n.TKey(language, "neInfo.noData")))
return
}
// 下发网管配置信息给网元
_, err = neService.NeConfigOMC(body)
if err == nil {
body.Status = "1"
} else {
body.Status = "0"
}
rows := s.neInfoService.Update(body)
if rows > 0 {
c.JSON(200, result.Ok(nil))