chore: 删除无用注释
This commit is contained in:
parent
b1ad068073
commit
4fbdbb15cc
@ -17,13 +17,13 @@ func CreateSubscription(c *gin.Context) {
|
|||||||
callbackURL := event.AttributedURIType(fmt.Sprintf("%s/onvif/subscriptions/%s/callback", config.Config.App.URL, xaddr))
|
callbackURL := event.AttributedURIType(fmt.Sprintf("%s/onvif/subscriptions/%s/callback", config.Config.App.URL, xaddr))
|
||||||
log.Printf("CreateSubscription callback URL: %s", callbackURL)
|
log.Printf("CreateSubscription callback URL: %s", callbackURL)
|
||||||
|
|
||||||
conn := onvif.Sessions[xaddr]
|
session := onvif.Sessions[xaddr]
|
||||||
if conn == nil {
|
if session == nil {
|
||||||
response.NewResponse().Fail("Connection not found").WithCode(http.StatusNotFound).Send(c)
|
response.NewResponse().Fail("Connection not found").WithCode(http.StatusNotFound).Send(c)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
result, err := conn.EventSubscribe(callbackURL, "PT60S")
|
result, err := session.EventSubscribe(callbackURL, "PT60S")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
response.NewResponse().Error(err).Send(c)
|
response.NewResponse().Error(err).Send(c)
|
||||||
return
|
return
|
||||||
@ -45,9 +45,5 @@ func NotifyCallback(c *gin.Context) {
|
|||||||
|
|
||||||
onvif.Notifications[xaddr] = append(onvif.Notifications[xaddr], notify.NotificationMessage...)
|
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)
|
response.NewResponse().Success().Send(c)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user