Commit d246d79f authored by Simon Pastor's avatar Simon Pastor
Browse files

demo1 supporting v2 loc-serv and rnis ut fix

parent 64eccb69
Loading
Loading
Loading
Loading
+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"`
}
+1 −5
Original line number Diff line number Diff line
@@ -23,10 +23,6 @@

package server

import (
	"time"
)

// User tracking notification - callback generated toward an ME app with a user tracking subscription
type UserTrackingNotification struct {

@@ -36,7 +32,7 @@ type UserTrackingNotification struct {
	UserInfo *UserInfo `json:"userInfo"`

	// Indicates the time of day for zonal presence notification.
	TimeStamp time.Time `json:"timeStamp"`
	TimeStamp TimeStamp `json:"timeStamp"`

	UserEventType *UserEventType `json:"userEventType,omitempty"`
}
Loading