24 lines
515 B
Go

package onvif
import (
"github.com/gin-gonic/gin"
"onvif-agent/response"
"onvif-agent/service/onvif"
)
func GetNotifications(c *gin.Context) {
response.NewResponse().WithData(onvif.Notifications).Send(c)
}
func GetNotificationByXaddr(c *gin.Context) {
xaddr := c.Param("xaddr")
response.NewResponse().WithData(onvif.Notifications[xaddr]).Send(c)
}
func DeleteNotificationByXaddr(c *gin.Context) {
xaddr := c.Param("xaddr")
delete(onvif.Notifications, xaddr)
response.NewResponse().Success().Send(c)
}