Loading go-apps/meep-app-enablement/server/capif-mgmt/service-mgmt.go +46 −2 Original line number Diff line number Diff line Loading @@ -717,9 +717,53 @@ func appServicesByIdPATCH(w http.ResponseWriter, r *http.Request) { } // else, nothing to do _sInfo.LivenessInterval = sInfoPrev.LivenessInterval // Send response // Map ServiceInfoList to ServiceApiDescription list serviceApiDescriptions := make([]ServiceApiDescription, 0) // Assuming _sInfo is an instance of ServiceInfo service := _sInfo // Create an AefProfile from TransportInfo inside ServiceInfo aefProfile := AefProfile{ AefId: service.TransportInfo.Id, Versions: []string{service.Version}, // Assuming Version is a string InterfaceDescriptions: service.TransportInfo.Endpoint, VendorSpecificUrnetsimeccapifexttransportInfo: &MecTransportInfoCapifExt{ Name: service.TransportInfo.Name, Type_: service.TransportInfo.Type_, Protocol: service.TransportInfo.Protocol, Version: service.TransportInfo.Version, Security: service.TransportInfo.Security, }, } // Create the ServiceApiDescription and populate it with data from ServiceInfo apiDesc := ServiceApiDescription{ ApiName: service.SerName, // Map SerName to ApiName ApiId: service.SerInstanceId, // Map SerInstanceId to ApiId AefProfiles: []AefProfile{aefProfile}, VendorSpecificUrnetsimeccapifextserviceInfo: &MecServiceInfoCapifExt{ Serializer: service.Serializer, State: service.State, ScopeOfLocality: service.ScopeOfLocality, ConsumedLocalOnly: service.ConsumedLocalOnly, IsLocal: service.IsLocal, Category: service.SerCategory, }, } // Add the created apiDesc to the serviceApiDescriptions slice serviceApiDescriptions = append(serviceApiDescriptions, apiDesc) // Prepare & send response jsonResponse, err := json.Marshal(serviceApiDescriptions) if err != nil { log.Error(err.Error()) errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) return } w.WriteHeader(http.StatusOK) fmt.Fprint(w, convertServiceInfoToJson_2(dsInfo)) fmt.Fprint(w, string(jsonResponse)) } func appServicesByIdDELETE(w http.ResponseWriter, r *http.Request) { Loading Loading
go-apps/meep-app-enablement/server/capif-mgmt/service-mgmt.go +46 −2 Original line number Diff line number Diff line Loading @@ -717,9 +717,53 @@ func appServicesByIdPATCH(w http.ResponseWriter, r *http.Request) { } // else, nothing to do _sInfo.LivenessInterval = sInfoPrev.LivenessInterval // Send response // Map ServiceInfoList to ServiceApiDescription list serviceApiDescriptions := make([]ServiceApiDescription, 0) // Assuming _sInfo is an instance of ServiceInfo service := _sInfo // Create an AefProfile from TransportInfo inside ServiceInfo aefProfile := AefProfile{ AefId: service.TransportInfo.Id, Versions: []string{service.Version}, // Assuming Version is a string InterfaceDescriptions: service.TransportInfo.Endpoint, VendorSpecificUrnetsimeccapifexttransportInfo: &MecTransportInfoCapifExt{ Name: service.TransportInfo.Name, Type_: service.TransportInfo.Type_, Protocol: service.TransportInfo.Protocol, Version: service.TransportInfo.Version, Security: service.TransportInfo.Security, }, } // Create the ServiceApiDescription and populate it with data from ServiceInfo apiDesc := ServiceApiDescription{ ApiName: service.SerName, // Map SerName to ApiName ApiId: service.SerInstanceId, // Map SerInstanceId to ApiId AefProfiles: []AefProfile{aefProfile}, VendorSpecificUrnetsimeccapifextserviceInfo: &MecServiceInfoCapifExt{ Serializer: service.Serializer, State: service.State, ScopeOfLocality: service.ScopeOfLocality, ConsumedLocalOnly: service.ConsumedLocalOnly, IsLocal: service.IsLocal, Category: service.SerCategory, }, } // Add the created apiDesc to the serviceApiDescriptions slice serviceApiDescriptions = append(serviceApiDescriptions, apiDesc) // Prepare & send response jsonResponse, err := json.Marshal(serviceApiDescriptions) if err != nil { log.Error(err.Error()) errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) return } w.WriteHeader(http.StatusOK) fmt.Fprint(w, convertServiceInfoToJson_2(dsInfo)) fmt.Fprint(w, string(jsonResponse)) } func appServicesByIdDELETE(w http.ResponseWriter, r *http.Request) { Loading