Unverified Commit 596a71d7 authored by Kevin Di Lallo's avatar Kevin Di Lallo Committed by GitHub
Browse files

Merge pull request #155 from pastorsx/sp_dev_loc_serv_demo1

Demo1 supporting v2 location service api and rnis ut fix
parents 9b2b7dfe 22f01bde
Loading
Loading
Loading
Loading
+23 −7
Original line number Diff line number Diff line
@@ -354,9 +354,7 @@ definitions:
      userInfo:
        $ref: "#/definitions/UserInfo"
      timeStamp:
        type: "string"
        format: "date-time"
        description: "Indicates the time of day for zonal presence notification."
        $ref: "#/definitions/TimeStamp"
      userEventType:
        $ref: "#/definitions/UserEventType"
    description: "User tracking notification - callback generated toward an ME app\
@@ -384,6 +382,27 @@ definitions:
        example: 7
        description: "The number of users currently on the access point"
    description: "A type containing zone information."
  TimeStamp:
    properties:
      nanoSeconds:
        description: The nanoseconds part of the time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC.
        format: int32
        type: integer
      seconds:
        description: The seconds part of the time. Time is defined as Unixtime since January 1, 1970, 00:00:00 UTC.
        format: int32
        type: integer
    required:
    - seconds
    - nanoSeconds
    type: object
  InlineTrackingNotification:
    type: "object"
    required:
    - "zonalPresenceNotification"
    properties:
      zonalPresenceNotification:
        $ref: "#/definitions/TrackingNotification"
  TrackingNotification:
    type: "object"
    required:
@@ -419,9 +438,7 @@ definitions:
        example: "001010000000000000000000000000001 or poa001"
        description: "Unique identifier of a point of access"
      timestamp:
        type: "string"
        format: "date-time"
        description: "Indicates the time of day for zonal presence notification."
        $ref: "#/definitions/TimeStamp"
    description: "Zonal or User tracking notification - callback generated toward\
      \ an ME app with a zonal or user tracking subscription"
    example:
@@ -432,7 +449,6 @@ definitions:
      zoneId: "zone001"
      interestRealma: "NY"
      currentAccessPointId: "001010000000000000000000000000001 or poa001"
      timestamp: "2017-01-01T02:51:43Z"
parameters:
  Path.UeId:
    name: "ueId"
+10 −8
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import (
	"net/http"
	"os"
	"time"
	"io/ioutil"

	mgm "github.com/InterDigitalInc/AdvantEDGE/mgmanagerapi"
)
@@ -208,20 +209,21 @@ func localDBHandleEvent(w http.ResponseWriter, r *http.Request) {
func localDBUpdateTrackedUes(w http.ResponseWriter, r *http.Request) {
	w.Header().Set("Content-Type", "application/json; charset=UTF-8")

	var notif TrackingNotification
	decoder := json.NewDecoder(r.Body)
	err := decoder.Decode(&notif)
	var notif InlineTrackingNotification
	bodyBytes, _ := ioutil.ReadAll(r.Body)
	err := json.Unmarshal(bodyBytes, &notif)
	if err != nil {
		log.Println(err.Error())
		http.Error(w, err.Error(), http.StatusInternalServerError)
		return
	}

	var userInfo UserInfo
	userInfo.Address = notif.Address
	userInfo.ZoneId = notif.ZoneId
	userInfo.AccessPointId = notif.CurrentAccessPointId
	userInfo.Address = notif.ZonalPresenceNotification.Address
	userInfo.ZoneId = notif.ZonalPresenceNotification.ZoneId
	userInfo.AccessPointId = notif.ZonalPresenceNotification.CurrentAccessPointId

	ueIdToUserInfoMap[notif.ZonalPresenceNotification.Address] = &userInfo

	ueIdToUserInfoMap[notif.Address] = &userInfo
	w.WriteHeader(http.StatusOK)

}
+16 −0
Original line number Diff line number Diff line
/*
 * MEEP Demo App API
 *
 * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
 *
 * API version: 0.0.1
 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
 */

package server

type InlineTrackingNotification struct {

	ZonalPresenceNotification *TrackingNotification `json:"zonalPresenceNotification"`
}
+17 −0
Original line number Diff line number Diff line
/*
 * MEEP Demo App API
 *
 * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
 *
 * API version: 0.0.1
 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
 */
package server

type TimeStamp struct {
        // The nanoseconds part of the time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC.
        NanoSeconds int32 `json:"nanoSeconds"`
        // The seconds part of the time. Time is defined as Unixtime since January 1, 1970, 00:00:00 UTC.
        Seconds int32 `json:"seconds"`
}
+1 −5
Original line number Diff line number Diff line
@@ -23,10 +23,6 @@

package server

import (
	"time"
)

// Zonal or User tracking notification - callback generated toward an ME app with a zonal or user tracking subscription
type TrackingNotification struct {

@@ -51,5 +47,5 @@ type TrackingNotification struct {
	PreviousAccessPointId string `json:"previousAccessPointId,omitempty"`

	// Indicates the time of day for zonal presence notification.
	Timestamp time.Time `json:"timestamp,omitempty"`
	Timestamp TimeStamp `json:"timestamp,omitempty"`
}
Loading