From 49fb4b1f915dac0a9034224321fe8eaa12258d61 Mon Sep 17 00:00:00 2001 From: imbytecat Date: Thu, 22 Aug 2024 11:55:00 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=BF=AE=E6=94=B9=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E4=B8=BA=20JSON?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- router/handler/onvif/subscription.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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"}) }