Loading examples/demo1/src/demo-server/go/localDB.go +10 −8 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import ( "net/http" "os" "time" "io/ioutil" mgm "github.com/InterDigitalInc/AdvantEDGE/mgmanagerapi" ) Loading Loading @@ -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(¬if) var notif InlineTrackingNotification bodyBytes, _ := ioutil.ReadAll(r.Body) err := json.Unmarshal(bodyBytes, ¬if) 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) } Loading examples/demo1/src/demo-server/go/model_inline_zonal_presence_notification.go 0 → 100644 +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"` } examples/demo1/src/demo-server/go/model_time_stamp.go 0 → 100644 +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"` } examples/demo1/src/demo-server/go/model_tracking_notification.go +1 −5 Original line number Diff line number Diff line Loading @@ -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 { Loading @@ -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"` } examples/demo1/src/demo-server/go/model_user_tracking_notification.go +1 −5 Original line number Diff line number Diff line Loading @@ -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 { Loading @@ -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
examples/demo1/src/demo-server/go/localDB.go +10 −8 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import ( "net/http" "os" "time" "io/ioutil" mgm "github.com/InterDigitalInc/AdvantEDGE/mgmanagerapi" ) Loading Loading @@ -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(¬if) var notif InlineTrackingNotification bodyBytes, _ := ioutil.ReadAll(r.Body) err := json.Unmarshal(bodyBytes, ¬if) 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) } Loading
examples/demo1/src/demo-server/go/model_inline_zonal_presence_notification.go 0 → 100644 +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"` }
examples/demo1/src/demo-server/go/model_time_stamp.go 0 → 100644 +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"` }
examples/demo1/src/demo-server/go/model_tracking_notification.go +1 −5 Original line number Diff line number Diff line Loading @@ -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 { Loading @@ -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"` }
examples/demo1/src/demo-server/go/model_user_tracking_notification.go +1 −5 Original line number Diff line number Diff line Loading @@ -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 { Loading @@ -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"` }