feat: 接口网元状态/网元列表
This commit is contained in:
@@ -20,3 +20,24 @@ type NeInfoImpl struct {
|
||||
func (r *NeInfoImpl) SelectNeInfoByNeTypeAndNeID(neType, neID string) model.NeInfo {
|
||||
return r.NeInfoRepository.SelectNeInfoByNeTypeAndNeID(neType, neID)
|
||||
}
|
||||
|
||||
// SelectNeList 查询网元列表
|
||||
func (r *NeInfoImpl) SelectNeList(ne model.NeInfo, bandStatus bool) []model.NeInfo {
|
||||
list := r.NeInfoRepository.SelectNeList(ne)
|
||||
|
||||
// 网元直连读取网元服务状态
|
||||
if bandStatus {
|
||||
neList := &list
|
||||
for i := range *neList {
|
||||
v := (*neList)[i]
|
||||
result, err := NeState(v)
|
||||
if err != nil {
|
||||
(*neList)[i].ServerState = map[string]any{}
|
||||
continue
|
||||
}
|
||||
(*neList)[i].ServerState = result
|
||||
}
|
||||
}
|
||||
|
||||
return list
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user