Merge remote-tracking branch 'origin/main' into lichang

This commit is contained in:
TsMask
2024-04-30 20:21:58 +08:00
34 changed files with 533 additions and 275 deletions

View File

@@ -142,7 +142,8 @@ func PostNeInfo(w http.ResponseWriter, r *http.Request) {
services.ResponseInternalServerError500ProcessError(w, err)
return
}
neInfo.UpdateTime = time.Now().Format(time.DateTime)
//neInfo.UpdateTime = time.Now().Format(time.DateTime)
neInfo.UpdateTime = time.Now()
log.Debug("NE info:", neInfo)
//if !config.GetYamlConfig().OMC.Chk2Ne {
@@ -166,7 +167,7 @@ func PostNeInfo(w http.ResponseWriter, r *http.Request) {
} else {
hostUri := global.CombineHostUri(neInfo.Ip, neInfo.Port)
//hostUri := fmt.Sprintf("http://%s:%v", neInfo.Ip, neInfo.Port)
apiUri := fmt.Sprintf("%s/systemManagement/v1/elementType/%s/objectType/config/omcNeConfig", config.DefaultUriPrefix, strings.ToLower(neInfo.NeType))
apiUri := fmt.Sprintf("%s/systemManagement/v1/elementType/%s/objectType/config/omcNeConfig?ne_id=%s", config.DefaultUriPrefix, strings.ToLower(neInfo.NeType), neInfo.NeId)
requestURI2NF := fmt.Sprintf("%s%s", hostUri, apiUri)
log.Debug("requestURI2NF:", requestURI2NF)
@@ -252,7 +253,7 @@ func PutNeInfo(w http.ResponseWriter, r *http.Request) {
neInfo := new(dborm.NeInfo)
_ = json.Unmarshal(body, neInfo)
neInfo.NeType = strings.ToUpper(neType)
neInfo.UpdateTime = time.Now().Format(time.DateTime)
neInfo.UpdateTime = time.Now()
log.Debug("NE info:", neInfo)
//if !config.GetYamlConfig().OMC.Chk2Ne {
@@ -276,7 +277,7 @@ func PutNeInfo(w http.ResponseWriter, r *http.Request) {
} else {
hostUri := global.CombineHostUri(neInfo.Ip, neInfo.Port)
//hostUri := fmt.Sprintf("http://%s:%v", neInfo.Ip, neInfo.Port)
apiUri := fmt.Sprintf("%s/systemManagement/v1/elementType/%s/objectType/config/omcNeConfig", config.DefaultUriPrefix, neTypeLower)
apiUri := fmt.Sprintf("%s/systemManagement/v1/elementType/%s/objectType/config/omcNeConfig?ne_id=%s", config.DefaultUriPrefix, neTypeLower, neInfo.NeId)
requestURI2NF := fmt.Sprintf("%s%s", hostUri, apiUri)
log.Debug("requestURI2NF:", requestURI2NF)

View File

@@ -42,7 +42,7 @@ func GetParamConfigFromNF(w http.ResponseWriter, r *http.Request) {
neInfo := neService.NewNeInfoImpl.SelectNeInfoByNeTypeAndNeID(neType, neId)
var response services.DataResponse
if neInfo.NeId == neId {
if neInfo.NeId == neId && neInfo.NeId != "" {
requestURI2NF := fmt.Sprintf("http://%s:%v%s", neInfo.IP, neInfo.Port, r.RequestURI)
log.Debug("requestURI2NF:", requestURI2NF)
@@ -78,7 +78,7 @@ func PostParamConfigToNF(w http.ResponseWriter, r *http.Request) {
neInfo := neService.NewNeInfoImpl.SelectNeInfoByNeTypeAndNeID(neType, neId)
if neInfo.NeId != neId {
if neInfo.NeId != neId || neInfo.NeId == "" {
log.Error("neId is empty")
services.ResponseInternalServerError500DatabaseOperationFailed(w)
return
@@ -130,7 +130,7 @@ func PutParamConfigToNF(w http.ResponseWriter, r *http.Request) {
neId := ctx.GetQuery(r, "ne_id")
neInfo := neService.NewNeInfoImpl.SelectNeInfoByNeTypeAndNeID(neType, neId)
if neInfo.NeId != neId {
if neInfo.NeId != neId || neInfo.NeId == "" {
log.Error("neId is empty")
services.ResponseInternalServerError500DatabaseOperationFailed(w)
return
@@ -183,7 +183,7 @@ func DeleteParamConfigToNF(w http.ResponseWriter, r *http.Request) {
neId := ctx.GetQuery(r, "ne_id")
neInfo := neService.NewNeInfoImpl.SelectNeInfoByNeTypeAndNeID(neType, neId)
if neInfo.NeId != neId {
if neInfo.NeId != neId || neInfo.NeId == "" {
log.Error("neId is empty")
services.ResponseInternalServerError500DatabaseOperationFailed(w)
return