chore: 删除无用注释

This commit is contained in:
Liam Chan 2024-08-27 15:30:34 +08:00
parent b1ad068073
commit 4fbdbb15cc

View File

@ -17,13 +17,13 @@ func CreateSubscription(c *gin.Context) {
callbackURL := event.AttributedURIType(fmt.Sprintf("%s/onvif/subscriptions/%s/callback", config.Config.App.URL, xaddr))
log.Printf("CreateSubscription callback URL: %s", callbackURL)
conn := onvif.Sessions[xaddr]
if conn == nil {
session := onvif.Sessions[xaddr]
if session == nil {
response.NewResponse().Fail("Connection not found").WithCode(http.StatusNotFound).Send(c)
return
}
result, err := conn.EventSubscribe(callbackURL, "PT60S")
result, err := session.EventSubscribe(callbackURL, "PT60S")
if err != nil {
response.NewResponse().Error(err).Send(c)
return
@ -45,9 +45,5 @@ func NotifyCallback(c *gin.Context) {
onvif.Notifications[xaddr] = append(onvif.Notifications[xaddr], notify.NotificationMessage...)
//for _, msg := range envelope.Body.Content.(*event.Notify).NotificationMessage {
// log.Printf("Topic: %s, Message: %s", msg.Topic.TopicKinds, msg.Message.Message)
//}
response.NewResponse().Success().Send(c)
}