Commit 48ddc733 authored by Simon Pastor's avatar Simon Pastor
Browse files

1st merge

parent b1f814d6
Loading
Loading
Loading
Loading
+10 −15
Original line number Diff line number Diff line
@@ -1181,18 +1181,16 @@ func geGetDistanceGeoDataByName(w http.ResponseWriter, r *http.Request) {
		return
	}

	srcLongStr := ""
	srcLatStr := ""
	position, err := ge.gisCache.GetPosition("*", assetName)
	if err != nil {
	if err != nil || position == nil {
		err := errors.New("Asset has no geo location")
		log.Error(err.Error())
		http.Error(w, err.Error(), http.StatusBadRequest)
		return
	}

	srcLongStr = strconv.FormatFloat(float64(position.Longitude), 'f', -1, 32)
	srcLatStr = strconv.FormatFloat(float64(position.Latitude), 'f', -1, 32)
	srcLongStr := strconv.FormatFloat(float64(position.Longitude), 'f', -1, 32)
	srcLatStr := strconv.FormatFloat(float64(position.Latitude), 'f', -1, 32)

	// Retrieve Distance parameters from request body
	var distanceParam TargetPoint
@@ -1227,7 +1225,7 @@ func geGetDistanceGeoDataByName(w http.ResponseWriter, r *http.Request) {
		// Find second asset in active scenario model
		position, err = ge.gisCache.GetPosition("*", distanceParam.AssetName)

		if err != nil {
		if err != nil || position == nil {
			err := errors.New("Destination asset has no geo location")
			log.Error(err.Error())
			http.Error(w, err.Error(), http.StatusBadRequest)
@@ -1299,20 +1297,17 @@ func geGetWithinRangeGeoDataByName(w http.ResponseWriter, r *http.Request) {
		return
	}

	srcLongStr := ""
	srcLatStr := ""
	if srcAsset.geoData != nil {
		srcPosition := srcAsset.geoData.position
		srcPoint := convertJsonToPoint(srcPosition)
		srcLongStr = strconv.FormatFloat(float64(srcPoint.Coordinates[0]), 'f', -1, 32)
		srcLatStr = strconv.FormatFloat(float64(srcPoint.Coordinates[1]), 'f', -1, 32)
	} else {
	position, err := ge.gisCache.GetPosition("*", assetName)
	if err != nil || position == nil {
		err := errors.New("Asset has no geo location")
		log.Error(err.Error())
		http.Error(w, err.Error(), http.StatusBadRequest)
		return
	}

	srcLongStr := strconv.FormatFloat(float64(position.Longitude), 'f', -1, 32)
	srcLatStr := strconv.FormatFloat(float64(position.Latitude), 'f', -1, 32)

	// Retrieve Within Range parameters from request body
	var withinRangeParam TargetRange
	if r.Body == nil {
@@ -1322,7 +1317,7 @@ func geGetWithinRangeGeoDataByName(w http.ResponseWriter, r *http.Request) {
		return
	}
	decoder := json.NewDecoder(r.Body)
	err := decoder.Decode(&withinRangeParam)
	err = decoder.Decode(&withinRangeParam)
	if err != nil {
		log.Error(err.Error())
		http.Error(w, err.Error(), http.StatusInternalServerError)
+47 −29
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ paths:
  /queries/distance:
    get:
      tags:
      - 'unsupported'
      - 'location'
      summary: 'UE Distance Lookup of a specific UE'
      description: 'UE Distance Lookup between terminals or a terminal and a location'
      operationId: distanceGET
@@ -207,7 +207,7 @@ paths:
  /subscriptions/area/circle:
    get:
      tags:
      - 'unsupported'
      - 'location'
      summary: 'Retrieves all active subscriptions to area change notifications'
      description: 'This operation is used for retrieving all active subscriptions to area change notifications.'
      operationId: areaCircleSubListGET
@@ -225,7 +225,8 @@ paths:
                    callbackReference:
                      callbackData: '1234'
                      notifyURL: 'http://clientApp.example.com/location_notifications/123456'
                    address: 'acr:10.0.0.1'
                    address:
                    - 'acr:10.0.0.1'
                    checkImmediate: true
                    enteringLeavingCriteria: 'Entering'
                    frequency: 10
@@ -237,7 +238,7 @@ paths:
                  resourceURL: 'http://meAppServer.example.com/location/v2/subscriptions/area/circle'
    post:
      tags:
      - 'unsupported'
      - 'location'
      summary: 'Creates a subscription for area change notification'
      description: 'Creates a subscription to the Location Service for an area change notification.'
      operationId: areaCircleSubPOST
@@ -254,7 +255,8 @@ paths:
                callbackReference:
                  callbackData: '1234'
                  notifyURL: 'http://clientApp.example.com/location_notifications/123456'
                address: 'acr:10.0.0.1'
                address:
                - 'acr:10.0.0.1'
                checkImmediate: true
                enteringLeavingCriteria: 'Entering'
                frequency: 10
@@ -275,7 +277,8 @@ paths:
                  callbackReference:
                    callbackData: '1234'
                    notifyURL: 'http://clientApp.example.com/location_notifications/123456'
                  address: 'acr:10.0.0.1'
                  address:
                  - 'acr:10.0.0.1'
                  checkImmediate: true
                  enteringLeavingCriteria: 'Entering'
                  frequency: 10
@@ -335,7 +338,7 @@ paths:
  /subscriptions/area/circle/{subscriptionId}:
    get:
      tags:
      - 'unsupported'
      - 'location'
      summary: 'Retrieve subscription information'
      description: 'Get subscription information.'
      operationId: areaCircleSubGET
@@ -354,7 +357,8 @@ paths:
                  callbackReference:
                    callbackData: '1234'
                    notifyURL: 'http://clientApp.example.com/location_notifications/123456'
                  address: 'acr:10.0.0.1'
                  address:
                  - 'acr:10.0.0.1'
                  checkImmediate: true
                  enteringLeavingCriteria: 'Entering'
                  frequency: 10
@@ -378,7 +382,7 @@ paths:
      x-swagger-router-controller: 'subscriptions'
    put:
      tags:
      - 'unsupported'
      - 'location'
      summary: 'Updates a subscription information'
      description: 'Updates a subscription.'
      operationId: areaCircleSubPUT
@@ -395,7 +399,8 @@ paths:
                callbackReference:
                  callbackData: '1234'
                  notifyURL: 'http://clientApp.example.com/location_notifications/123456'
                address: 'acr:10.0.0.1'
                address:
                - 'acr:10.0.0.1'
                checkImmediate: true
                enteringLeavingCriteria: 'Entering'
                frequency: 10
@@ -419,7 +424,8 @@ paths:
                  callbackReference:
                    callbackData: '1234'
                    notifyURL: 'http://clientApp.example.com/location_notifications/123456'
                  address: 'acr:10.0.0.1'
                  address:
                  - 'acr:10.0.0.1'
                  checkImmediate: true
                  enteringLeavingCriteria: 'Entering'
                  frequency: 10
@@ -447,7 +453,7 @@ paths:
      x-swagger-router-controller: 'subscriptions'
    delete:
      tags:
      - 'unsupported'
      - 'location'
      summary: 'Cancel a subscription'
      description: 'Method to delete a subscription.'
      operationId: areaCircleSubDELETE
@@ -468,7 +474,7 @@ paths:
  /subscriptions/distance:
    get:
      tags:
      - 'unsupported'
      - 'location'
      summary: 'Retrieves all active subscriptions to distance change notifications'
      description: 'This operation is used for retrieving all active subscriptions to a distance change notifications.'
      operationId: distanceSubListGET
@@ -493,13 +499,14 @@ paths:
                    criteria: 'AllWithinDistance'
                    distance: 100
                    frequency: 10
                    referenceAddress: 'acr:10.0.0.3'
                    referenceAddress:
                    - 'acr:10.0.0.3'
                    trackingAccuracy: 10
                    resourceURL: 'http://meAppServer.example.com/location/v2/subscriptions/distance/sub123'
                  resourceURL: 'http://meAppServer.example.com/location/v2/subscriptions/distance'
    post:
      tags:
      - 'unsupported'
      - 'location'
      summary: 'Creates a subscription for distance change notification'
      description: 'Creates a subscription to the Location Service for a distance change notification.'
      operationId: distanceSubPOST
@@ -523,7 +530,8 @@ paths:
                criteria: 'AllWithinDistance'
                distance: 100
                frequency: 10
                referenceAddress: 'acr:10.0.0.3'
                referenceAddress: 
                - 'acr:10.0.0.3'
                trackingAccuracy: 10
      responses:
        '201':
@@ -545,7 +553,8 @@ paths:
                  criteria: 'AllWithinDistance'
                  distance: 100
                  frequency: 10
                  referenceAddress: 'acr:10.0.0.3'
                  referenceAddress:
                  - 'acr:10.0.0.3'
                  trackingAccuracy: 10
                  resourceURL: 'http://meAppServer.example.com/location/v2/subscriptions/distance/subscription123'
        '400':
@@ -609,7 +618,7 @@ paths:
  /subscriptions/distance/{subscriptionId}:
    get:
      tags:
      - 'unsupported'
      - 'location'
      summary: 'Retrieve subscription information'
      description: 'Get subscription information.'
      operationId: distanceSubGET
@@ -635,7 +644,8 @@ paths:
                  criteria: 'AllWithinDistance'
                  distance: 100
                  frequency: 10
                  referenceAddress: 'acr:10.0.0.3'
                  referenceAddress:
                  - 'acr:10.0.0.3'
                  trackingAccuracy: 10
                  resourceURL: 'http://meAppServer.example.com/location/v2/subscriptions/distance/subscription123'
        '400':
@@ -653,7 +663,7 @@ paths:
      x-swagger-router-controller: 'subscriptions'
    put:
      tags:
      - 'unsupported'
      - 'location'
      summary: 'Updates a subscription information'
      description: 'Updates a subscription.'
      operationId: distanceSubPUT
@@ -677,7 +687,8 @@ paths:
                criteria: 'AllWithinDistance'
                distance: 100
                frequency: 10
                referenceAddress: 'acr:10.0.0.3'
                referenceAddress: 
                - 'acr:10.0.0.3'
                trackingAccuracy: 10
                resourceURL: 'http://meAppServer.example.com/location/v2/subscriptions/distance/subscription123'
      parameters:
@@ -702,7 +713,8 @@ paths:
                  criteria: 'AllWithinDistance'
                  distance: 100
                  frequency: 10
                  referenceAddress: 'acr:10.0.0.3'
                  referenceAddress:
                  - 'acr:10.0.0.3'
                  trackingAccuracy: 10
                  resourceURL: 'http://meAppServer.example.com/location/v2/subscriptions/distance/subscription123'
        '400':
@@ -724,7 +736,7 @@ paths:
      x-swagger-router-controller: 'subscriptions'
    delete:
      tags:
      - 'unsupported'
      - 'location'
      summary: 'Cancel a subscription'
      description: 'Method to delete a subscription.'
      operationId: distanceSubDELETE
@@ -763,7 +775,8 @@ paths:
                    callbackReference:
                      callbackData: '1234'
                      notifyURL: 'http://clientApp.example.com/location_notifications/123456'
                    address: 'acr:10.0.0.1'
                    address: 
                    - 'acr:10.0.0.1'
                    frequency: 10
                    requestedAccuracy: 10
                    resourceURL: 'http://meAppServer.example.com/location/v2/subscriptions/periodic/subscription123'
@@ -787,7 +800,8 @@ paths:
                callbackReference:
                  callbackData: '1234'
                  notifyURL: 'http://clientApp.example.com/location_notifications/123456'
                address: 'acr:10.0.0.1'
                address: 
                - 'acr:10.0.0.1'
                frequency: 10
                requestedAccuracy: 10
      responses:
@@ -803,7 +817,8 @@ paths:
                  callbackReference:
                    callbackData: '1234'
                    notifyURL: 'http://clientApp.example.com/location_notifications/123456'
                  address: 'acr:10.0.0.1'
                  address: 
                  - 'acr:10.0.0.1'
                  frequency: 10
                  requestedAccuracy: 10
                  resourceURL: 'http://meAppServer.example.com/location/v2/subscriptions/periodic/subscription123'
@@ -876,7 +891,8 @@ paths:
                  callbackReference:
                    callbackData: '1234'
                    notifyURL: 'http://clientApp.example.com/location_notifications/123456'
                  address: 'acr:10.0.0.1'
                  address:
                  - 'acr:10.0.0.1'
                  frequency: 10
                  requestedAccuracy: 10
                  resourceURL: 'http://meAppServer.example.com/location/v2/subscriptions/periodic/subscription123'
@@ -912,7 +928,8 @@ paths:
                callbackReference:
                  callbackData: '1234'
                  notifyURL: 'http://clientApp.example.com/location_notifications/123456'
                address: 'acr:10.0.0.1'
                address: 
                - 'acr:10.0.0.1'
                frequency: 10
                requestedAccuracy: 10
                resourceURL: 'http://meAppServer.example.com/location/v2/subscriptions/periodic/subscription123'
@@ -931,7 +948,8 @@ paths:
                  callbackReference:
                    callbackData: '1234'
                    notifyURL: 'http://clientApp.example.com/location_notifications/123456'
                  address: 'acr:10.0.0.1'
                  address:
                  - 'acr:10.0.0.1'
                  frequency: 10
                  requestedAccuracy: 10
                  resourceURL: 'http://meAppServer.example.com/location/v2/subscriptions/periodic/subscription123'
+2 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ require (
	github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-data-key-mgr v0.0.0
	github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-data-model v0.0.0
	github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-gis-cache v0.0.0
        github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-gis-engine-client v0.0.0
	github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-http-logger v0.0.0
	github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger v0.0.0
	github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-metrics v0.0.0
@@ -21,6 +22,7 @@ replace (
	github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-data-key-mgr => ../../go-packages/meep-data-key-mgr
	github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-data-model => ../../go-packages/meep-data-model
	github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-gis-cache => ../../go-packages/meep-gis-cache
        github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-gis-engine-client => ../../go-packages/meep-gis-engine-client
	github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-http-logger => ../../go-packages/meep-http-logger
	github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger => ../../go-packages/meep-logger
	github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-metrics => ../../go-packages/meep-metrics
+6 −0
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
@@ -328,9 +330,12 @@ golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200625001655-4c5254603344 h1:vGXIOMxbNfDTk/aXCmfdLgkrSV+Z2tcbze+pEc3v5W4=
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -382,6 +387,7 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T
google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ To see how to make this your own, look here:
[README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md)

- API version: 2.1.1
- Build date: 2021-05-26T11:20:47.393-04:00[America/New_York]
- Build date: 2021-06-04T14:31:47.435-04:00[America/New_York]


### Running the server
Loading