fix: 网元参数omcNeConfig接口转发带ne_id参数

This commit is contained in:
TsMask
2024-04-26 15:03:31 +08:00
parent 527009d311
commit e4262dde2c
2 changed files with 6 additions and 6 deletions

View File

@@ -167,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)
@@ -277,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