1
0

marge: 合并代码

This commit is contained in:
TsMask
2024-02-07 12:31:25 +08:00
parent 6d9123314c
commit d5f7a2077e
65 changed files with 2445 additions and 99 deletions

View File

@@ -16,6 +16,7 @@ import (
"ems.agt/lib/services"
"ems.agt/restagent/config"
tokenConst "ems.agt/src/framework/constants/token"
neService "ems.agt/src/modules/network_element/service"
"github.com/go-resty/resty/v2"
"github.com/gorilla/mux"
@@ -136,7 +137,7 @@ func PostNeInfo(w http.ResponseWriter, r *http.Request) {
services.ResponseNotFound404UriNotExist(w, r)
return
}
log.Debug("Body:", string(body))
log.Trace("Body:", string(body))
neInfo := new(dborm.NeInfo)
err = json.Unmarshal(body, neInfo)
@@ -158,6 +159,9 @@ func PostNeInfo(w http.ResponseWriter, r *http.Request) {
return
}
// 刷新缓存不存在结构体网元Id空字符串
neService.NewNeInfoImpl.RefreshByNeTypeAndNeID(neInfo.NeType, neInfo.NeId)
mapRow := make(map[string]interface{})
row := map[string]interface{}{"affectedRows": affected}
mapRow["data"] = row
@@ -205,6 +209,10 @@ func PostNeInfo(w http.ResponseWriter, r *http.Request) {
} else if affected <= 0 {
log.Infof("Not record affected to insert ne_info")
}
// 刷新缓存不存在结构体网元Id空字符串
neService.NewNeInfoImpl.RefreshByNeTypeAndNeID(neInfo.NeType, neInfo.NeId)
services.ResponseStatusOK204NoContent(w)
return
default:
@@ -261,6 +269,9 @@ func PutNeInfo(w http.ResponseWriter, r *http.Request) {
return
}
// 刷新缓存不存在结构体网元Id空字符串
neService.NewNeInfoImpl.RefreshByNeTypeAndNeID(neInfo.NeType, neInfo.NeId)
mapRow := make(map[string]interface{})
row := map[string]interface{}{"affectedRows": affected}
mapRow["data"] = row
@@ -309,6 +320,10 @@ func PutNeInfo(w http.ResponseWriter, r *http.Request) {
} else if affected <= 0 {
log.Infof("Not record affected to insert ne_info")
}
// 刷新缓存不存在结构体网元Id空字符串
neService.NewNeInfoImpl.RefreshByNeTypeAndNeID(neInfo.NeType, neInfo.NeId)
services.ResponseStatusOK204NoContent(w)
return
default:
@@ -390,6 +405,9 @@ func DeleteNeInfo(w http.ResponseWriter, r *http.Request) {
return
}
// 刷新缓存不存在结构体网元Id空字符串
neService.NewNeInfoImpl.RefreshByNeTypeAndNeID(neInfo.NeType, neInfo.NeId)
mapRow := make(map[string]interface{})
row := map[string]interface{}{"affectedRows": affected}
mapRow["data"] = row