Loading examples/demo1/src/demo-server/api/swagger.yaml +23 −7 Original line number Diff line number Diff line Loading @@ -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\ Loading Loading @@ -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: Loading Loading @@ -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: Loading @@ -432,7 +449,6 @@ definitions: zoneId: "zone001" interestRealma: "NY" currentAccessPointId: "001010000000000000000000000000001 or poa001" timestamp: "2017-01-01T02:51:43Z" parameters: Path.UeId: name: "ueId" 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"` } Loading
examples/demo1/src/demo-server/api/swagger.yaml +23 −7 Original line number Diff line number Diff line Loading @@ -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\ Loading Loading @@ -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: Loading Loading @@ -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: Loading @@ -432,7 +449,6 @@ definitions: zoneId: "zone001" interestRealma: "NY" currentAccessPointId: "001010000000000000000000000000001 or poa001" timestamp: "2017-01-01T02:51:43Z" parameters: Path.UeId: name: "ueId" 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"` }