Commit 1aafa095 authored by Ikram Haq's avatar Ikram Haq
Browse files

Clean the code

parent 29cdfe1c
Loading
Loading
Loading
Loading
+1 −29
Original line number Diff line number Diff line
@@ -521,7 +521,6 @@ func appServicesByIdPUT(w http.ResponseWriter, r *http.Request) {
	}

	// Current implementation only supports state parameter change;
	// Make sure none of the other service information fields have changed
	state := *_sInfo.State
	*_sInfo.State = *sInfoPrev.State
	// isLocal is only set in responses, subscriptions and notifications;
@@ -686,11 +685,6 @@ func appServicesByIdPATCH(w http.ResponseWriter, r *http.Request) {
	}

	// Current implementation only supports state parameter change;
	// Make sure none of the other service information fields have changed
	// state := *_sInfo.State
	// *_sInfo.State = *sInfoPrev.State
	// isLocal is only set in responses, subscriptions and notifications;
	// Ignore this field while comparing the previous & new service info structs
	_sInfo.IsLocal = sInfoPrev.IsLocal

	// Compare service information as JSON strings
@@ -740,23 +734,8 @@ func appServicesByIdPATCH(w http.ResponseWriter, r *http.Request) {
	// 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
@@ -1107,14 +1086,7 @@ func applicationsSubscriptionsPUT(w http.ResponseWriter, r *http.Request) {
	if updatedSub.NotificationDestination != "" {
		sub.Cfg.NotifyUrl = updatedSub.NotificationDestination
	}
	// if updatedSub.RequestTestNotification {
	// 	sub.Cfg.RequestTestNotif = true
	// }
	// if updatedSub.RequestWebsocketUri {
	// 	sub.Cfg.RequestWebsocketUri = true
	// } else {
	// 	sub.Cfg.RequestWebsocketUri = false
	// }

	// Update event filters if provided
	if updatedSub.EventFilters != nil {
		sub.Cfg.EventFilters = convertEventFiltersToStrings(updatedSub.EventFilters)