Commit d9f6dbfc authored by Ikram Haq's avatar Ikram Haq
Browse files

Remove unnecessary code for zonalTrafficSubscription (v2.2.1) and...

Remove unnecessary code for zonalTrafficSubscription (v2.2.1) and zoneStatusSubscription and fix issue in geographicToCartesian function
parent 9ecf6901
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -305,6 +305,10 @@ func processActiveScenarioUpdate() {
			latitude = &position.Latitude

		}
		if longitude == nil || latitude == nil {
			log.Info("Longitude or Latitude is nil for UE:", name)
			continue
		}
		// Convert user's geographic coordinates to Cartesian coordinates relative to the origin
		x, y := geographicToCartesian(latitude, longitude, originLatitude, originLongitude)
		var X *float64 = &x
@@ -450,6 +454,10 @@ func refreshPositions() {
			longitude = &position.Longitude
			latitude = &position.Latitude
		}
		if longitude == nil || latitude == nil {
			log.Info("Longitude or Latitude is nil for UE:", name)
			continue
		}
		x, y := geographicToCartesian(latitude, longitude, originLatitude, originLongitude)
		var X *float64 = &x
		var Y *float64 = &y
+0 −31
Original line number Diff line number Diff line
@@ -105,14 +105,6 @@ func UsersGET(w http.ResponseWriter, r *http.Request) {
	usersGet(w, r)
}

func ZonalTrafficSubDELETE(w http.ResponseWriter, r *http.Request) {
	zonalTrafficSubDelete(w, r)
}

func ZonalTrafficSubGET(w http.ResponseWriter, r *http.Request) {
	zonalTrafficSubGet(w, r)
}

func ZoneSubListGET(w http.ResponseWriter, r *http.Request) {
	zoneSubListGET(w, r)
}
@@ -130,29 +122,6 @@ func ZoneSubPUT(w http.ResponseWriter, r *http.Request) {
func ZoneSubDELETE(w http.ResponseWriter, r *http.Request) {
	zoneSubDELETE(w, r)
}
func ZonalTrafficSubPOST(w http.ResponseWriter, r *http.Request) {
	zonalTrafficSubPost(w, r)
}

func ZonalTrafficSubPUT(w http.ResponseWriter, r *http.Request) {
	zonalTrafficSubPut(w, r)
}

func ZoneStatusSubDELETE(w http.ResponseWriter, r *http.Request) {
	zoneStatusSubDelete(w, r)
}

func ZoneStatusSubGET(w http.ResponseWriter, r *http.Request) {
	zoneStatusSubGet(w, r)
}

// func ZoneStatusSubPOST(w http.ResponseWriter, r *http.Request) {
// 	zoneStatusSubPost(w, r)
// }

// func ZoneStatusSubPUT(w http.ResponseWriter, r *http.Request) {
// 	zoneStatusSubPut(w, r)
// }

func ZonesGET(w http.ResponseWriter, r *http.Request) {
	zonesGet(w, r)
+0 −26
Original line number Diff line number Diff line
@@ -137,32 +137,6 @@ func convertZonalSubscriptionToJson1(zonalSubs *ZoneLocationEventSubscription) s
	return string(jsonInfo)
}

func convertZonalSubscriptionToJson(zonalSubs *ZonalTrafficSubscription) string {

	jsonInfo, err := json.Marshal(*zonalSubs)
	if err != nil {
		log.Error(err.Error())
		return ""
	}

	return string(jsonInfo)
}

func convertJsonToZonalSubscription(jsonInfo string) *ZonalTrafficSubscription {

	if jsonInfo == "" {
		return nil
	}

	var zonal ZonalTrafficSubscription
	err := json.Unmarshal([]byte(jsonInfo), &zonal)
	if err != nil {
		log.Error(err.Error())
		return nil
	}
	return &zonal
}

func convertJsonToZonalSubscription_1(jsonInfo string) *ZoneLocationEventSubscription {

	if jsonInfo == "" {
+9 −626

File changed.

Preview size limit exceeded, changes collapsed.

+0 −28
Original line number Diff line number Diff line
/*
 * Copyright (c) 2022  The AdvantEDGE Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * AdvantEDGE Location API
 *
 * Location Service is AdvantEDGE's implementation of [ETSI MEC ISG MEC013 Location API](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/013/02.02.01_60/gs_mec013v020201p.pdf) <p>The API is based on the Open Mobile Alliance's specification RESTful Network API for Zonal Presence <p>[Copyright (c) ETSI 2017](https://forge.etsi.org/etsi-forge-copyright-notice.txt) <p>**Micro-service**<br>[meep-loc-serv](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-loc-serv) <p>**Type & Usage**<br>Edge Service used by edge applications that want to get information about Users (UE) and Zone locations <p>**Note**<br>AdvantEDGE supports all of Location API endpoints (see below).
 *
 * API version: 2.2.1
 * Contact: AdvantEDGE@InterDigital.com
 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
 */
package server

type InlineZonalTrafficSubscription struct {
	ZonalTrafficSubscription *ZonalTrafficSubscription `json:"zonalTrafficSubscription,omitempty"`
}
Loading