diff --git a/router/handler/onvif/subscription.go b/router/handler/onvif/subscription.go index b2760d5..b142e32 100644 --- a/router/handler/onvif/subscription.go +++ b/router/handler/onvif/subscription.go @@ -12,7 +12,6 @@ import ( func CreateEventSubscription(c *gin.Context) { xaddr := c.Param("xaddr") - // FIXME: 把参数变成传入的参数 callbackURL := event.AttributedURIType(fmt.Sprintf("%s/subscriptions/callback", config.Conf.App.URL)) result, err := conns[xaddr].SubscribeEvents(callbackURL, "PT60S") if err != nil { @@ -33,9 +32,10 @@ func EventNotifyCallback(c *gin.Context) { return } + // TODO: handle notifications for _, msg := range envelope.Body.Content.(*event.Notify).NotificationMessage { log.Println(msg.Topic.TopicKinds, msg.Message.Message) } - c.String(http.StatusOK, "OK") + c.JSON(http.StatusOK, gin.H{"message": "OK"}) }