Loading go-apps/meep-vis/server/api_v2xi.go +1 −1 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ func IndividualSubscriptionDELETE(w http.ResponseWriter, r *http.Request) { } func IndividualSubscriptionGET(w http.ResponseWriter, r *http.Request) { notImplemented(w, r) individualSubscriptionGET(w, r) } func IndividualSubscriptionPUT(w http.ResponseWriter, r *http.Request) { Loading go-apps/meep-vis/server/vis.go +31 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import ( scc "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-sandbox-ctrl-client" smc "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-service-mgmt-client" sm "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-subscriptions" "github.com/gorilla/mux" ) const moduleName = "meep-vis" Loading Loading @@ -991,6 +992,36 @@ func subscriptionsPost(w http.ResponseWriter, r *http.Request) { fmt.Fprint(w, jsonResponse) } func individualSubscriptionGET(w http.ResponseWriter, r *http.Request) { log.Info("subGet") w.Header().Set("Content-Type", "application/json; charset=UTF-8") vars := mux.Vars(r) subsIdStr := vars["subsId"] keyName := baseKey + "subscriptions:" + subsIdStr // Find subscription entry in Redis DB v2xMsgJson, err := rc.JSONGetEntry(keyName, ".") if v2xMsgJson == "" { w.WriteHeader(http.StatusNotFound) return } // Prepare & send v2xMsgSubscription as a response var v2xMsgSubResp V2xMsgSubscription err = json.Unmarshal([]byte(v2xMsgJson), &v2xMsgSubResp) if err != nil { log.Error(err.Error()) errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) return } jsonResponse := convertV2xMsgSubscriptionToJson(&v2xMsgSubResp) w.WriteHeader(http.StatusOK) fmt.Fprint(w, jsonResponse) } func registerV2xSub(v2xMsgSubscription *V2xMsgSubscription, subId string) { subsId, _ := strconv.Atoi(subId) mutex.Lock() Loading Loading
go-apps/meep-vis/server/api_v2xi.go +1 −1 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ func IndividualSubscriptionDELETE(w http.ResponseWriter, r *http.Request) { } func IndividualSubscriptionGET(w http.ResponseWriter, r *http.Request) { notImplemented(w, r) individualSubscriptionGET(w, r) } func IndividualSubscriptionPUT(w http.ResponseWriter, r *http.Request) { Loading
go-apps/meep-vis/server/vis.go +31 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import ( scc "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-sandbox-ctrl-client" smc "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-service-mgmt-client" sm "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-subscriptions" "github.com/gorilla/mux" ) const moduleName = "meep-vis" Loading Loading @@ -991,6 +992,36 @@ func subscriptionsPost(w http.ResponseWriter, r *http.Request) { fmt.Fprint(w, jsonResponse) } func individualSubscriptionGET(w http.ResponseWriter, r *http.Request) { log.Info("subGet") w.Header().Set("Content-Type", "application/json; charset=UTF-8") vars := mux.Vars(r) subsIdStr := vars["subsId"] keyName := baseKey + "subscriptions:" + subsIdStr // Find subscription entry in Redis DB v2xMsgJson, err := rc.JSONGetEntry(keyName, ".") if v2xMsgJson == "" { w.WriteHeader(http.StatusNotFound) return } // Prepare & send v2xMsgSubscription as a response var v2xMsgSubResp V2xMsgSubscription err = json.Unmarshal([]byte(v2xMsgJson), &v2xMsgSubResp) if err != nil { log.Error(err.Error()) errHandlerProblemDetails(w, err.Error(), http.StatusInternalServerError) return } jsonResponse := convertV2xMsgSubscriptionToJson(&v2xMsgSubResp) w.WriteHeader(http.StatusOK) fmt.Fprint(w, jsonResponse) } func registerV2xSub(v2xMsgSubscription *V2xMsgSubscription, subId string) { subsId, _ := strconv.Atoi(subId) mutex.Lock() Loading