refactor(router): 改为结构化 web 项目
This commit is contained in:
@ -2,7 +2,7 @@ package router
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"onvif-agent/router/handler"
|
||||
"onvif-agent/router/handler/onvif"
|
||||
)
|
||||
|
||||
func SetupRoutes(r *gin.Engine) {
|
||||
@ -11,8 +11,16 @@ func SetupRoutes(r *gin.Engine) {
|
||||
{
|
||||
connectionGroup := userGroup.Group("/connections")
|
||||
{
|
||||
connectionGroup.GET("/", handler.GetConnections)
|
||||
connectionGroup.POST("/", handler.CreateConnection)
|
||||
connectionGroup.POST("/", onvif.CreateConnection)
|
||||
connectionGroup.GET("/", onvif.GetConnections)
|
||||
connectionGroup.GET("/:xaddr", onvif.GetConnectionByXaddr)
|
||||
connectionGroup.DELETE("/:xaddr", onvif.DeleteConnection)
|
||||
}
|
||||
|
||||
subscriptionGroup := userGroup.Group("/subscriptions")
|
||||
{
|
||||
subscriptionGroup.POST("/:xaddr", onvif.CreateEventSubscription)
|
||||
subscriptionGroup.POST("/callback", onvif.EventNotifyCallback)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user