isapi.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package isapi
  2. import (
  3. "github.com/gin-gonic/gin"
  4. v1 "lcfns/api/v1"
  5. "lcfns/middleware"
  6. )
  7. type IsApiRouter struct {
  8. }
  9. func (i *IsApiRouter) InitInfoRouter(Router *gin.RouterGroup) {
  10. var is = v1.ApiGroupApp.ISAPIApiGroup
  11. //摄像头系统相关
  12. sys := Router.Group("/ISAPI/System/")
  13. {
  14. sys.GET("deviceInfo", is.GetInfo)
  15. sys.GET("capabilities", is.GetCap)
  16. sys.PUT("Network/mailing/1", is.PutEmail)
  17. }
  18. //摄像头智能事件
  19. smart := Router.Group("/ISAPI/Smart/").Use(middleware.OperationRecord())
  20. smartNoRecord := Router.Group("/ISAPI/Smart/")
  21. {
  22. //区域入侵
  23. smartNoRecord.GET("FieldDetection/1/capabilities", is.GetFieldDectionCap)
  24. smartNoRecord.GET("channels/1/calibrations/FieldDetection", is.GetSizeFd)
  25. smart.PUT("channels/1/calibrations/FieldDetection", is.PutSizeFd)
  26. smartNoRecord.GET("FieldDetection/1", is.GetFieldDection)
  27. smart.PUT("FieldDetection/1", is.PutFieldDection)
  28. //越界侦测
  29. smartNoRecord.GET("LineDetection/1/capabilities", is.GetLineDetectionCap)
  30. smartNoRecord.GET("channels/1/calibrations/linedetection", is.GetSizeLd)
  31. smart.PUT("channels/1/calibrations/linedetection", is.PutSizeLd)
  32. smartNoRecord.GET("LineDetection/1", is.GetLineDetection)
  33. smart.PUT("LineDetection/1", is.PutLineDetection)
  34. //进入区域
  35. smartNoRecord.GET("regionEntrance/1/capabilities", is.GetRegionEntranceCap)
  36. smartNoRecord.GET("channels/1/calibrations/regionEntrance", is.GetSizeRe)
  37. smart.PUT("channels/1/calibrations/regionEntrance", is.PutSizeRe)
  38. smartNoRecord.GET("regionEntrance/1", is.GetRegionEntrance)
  39. smart.PUT("regionEntrance/1", is.PutRegionEntrance)
  40. }
  41. }