feat: 网元信息查询带主机信息查询函数
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user