feat: 网元状态3待机判断standby
This commit is contained in:
@@ -233,13 +233,13 @@ func (s *NeInfoController) OAMFileWrite(c *gin.Context) {
|
||||
//
|
||||
// GET /list
|
||||
func (s *NeInfoController) List(c *gin.Context) {
|
||||
querys := ctx.QueryMap(c)
|
||||
query := ctx.QueryMapString(c)
|
||||
bandStatus := false
|
||||
if v, ok := querys["bandStatus"]; ok && v != nil {
|
||||
if v, ok := query["bandStatus"]; ok {
|
||||
bandStatus = parse.Boolean(v)
|
||||
}
|
||||
data := s.neInfoService.SelectPage(querys, bandStatus)
|
||||
c.JSON(200, result.Ok(data))
|
||||
rows, total := s.neInfoService.SelectPage(query, bandStatus)
|
||||
c.JSON(200, result.Ok(map[string]any{"rows": rows, "total": total}))
|
||||
}
|
||||
|
||||
// 网元信息
|
||||
@@ -289,11 +289,13 @@ func (s *NeInfoController) Add(c *gin.Context) {
|
||||
if err != nil {
|
||||
body.Status = "0"
|
||||
} else {
|
||||
// 网元状态设置为在线
|
||||
body.Status = "1"
|
||||
if parse.Boolean(body.ServerState["standby"]) {
|
||||
body.Status = "3"
|
||||
}
|
||||
// 下发网管配置信息给网元
|
||||
_, err = neFetchlink.NeConfigOMC(body)
|
||||
if err == nil {
|
||||
body.Status = "1"
|
||||
} else {
|
||||
if _, err = neFetchlink.NeConfigOMC(body); err != nil {
|
||||
body.Status = "2"
|
||||
}
|
||||
}
|
||||
@@ -380,11 +382,13 @@ func (s *NeInfoController) Edit(c *gin.Context) {
|
||||
if err != nil {
|
||||
body.Status = "0"
|
||||
} else {
|
||||
// 网元状态设置为在线
|
||||
body.Status = "1"
|
||||
if parse.Boolean(body.ServerState["standby"]) {
|
||||
body.Status = "3"
|
||||
}
|
||||
// 下发网管配置信息给网元
|
||||
_, err = neFetchlink.NeConfigOMC(body)
|
||||
if err == nil {
|
||||
body.Status = "1"
|
||||
} else {
|
||||
if _, err = neFetchlink.NeConfigOMC(body); err != nil {
|
||||
body.Status = "2"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user