isapi.go 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package isapi
  2. import (
  3. "github.com/gin-gonic/gin"
  4. v1 "lc-fangdaosha/api/v1"
  5. "lc-fangdaosha/middleware"
  6. )
  7. type IsApiRouter struct {
  8. }
  9. // InitInfoRouter 初始化isapi路由
  10. func (i *IsApiRouter) InitInfoRouter(Router *gin.RouterGroup) {
  11. var is = v1.ApiGroupApp.IsApiGroup
  12. //摄像头系统相关
  13. sys := Router.Group("/ISAPI/System/")
  14. {
  15. sys.GET("deviceInfo", is.GetInfo) //获取设备信息
  16. sys.GET("capabilities", is.GetCap) //获取设备能力集
  17. sys.PUT("Network/mailing/1", is.PutEmail) //设置邮件通知
  18. }
  19. //摄像头智能事件
  20. smart := Router.Group("/ISAPI/Smart/").Use(middleware.OperationRecord())
  21. smartNoRecord := Router.Group("/ISAPI/Smart/")
  22. {
  23. //区域入侵
  24. smartNoRecord.GET("FieldDetection/1/capabilities", is.GetFieldDetection) //获取单个通道区域入侵能力集
  25. smartNoRecord.GET("channels/1/calibrations/FieldDetection", is.GetSizeFd) //获取区域入侵尺寸
  26. smart.PUT("channels/1/calibrations/FieldDetection", is.PutSizeFd) //设置区域入侵尺寸
  27. smartNoRecord.GET("FieldDetection/1", is.GetFieldDetection) //获取单个通道区域入侵规则
  28. smart.PUT("FieldDetection/1", is.PutFieldDetection) //设置单个通道区域入侵规则
  29. //越界侦测
  30. smartNoRecord.GET("LineDetection/1/capabilities", is.GetLineDetectionCap) //获取越界侦测能力集
  31. smartNoRecord.GET("channels/1/calibrations/linedetection", is.GetSizeLd) //获取越界侦测尺寸
  32. smart.PUT("channels/1/calibrations/linedetection", is.PutSizeLd) //配置越界侦测的尺寸
  33. smartNoRecord.GET("LineDetection/1", is.GetLineDetection) //获取越界侦测
  34. smart.PUT("LineDetection/1", is.PutLineDetection) //设置越界侦测
  35. //进入区域
  36. smartNoRecord.GET("regionEntrance/1/capabilities", is.GetRegionEntranceCap) //获取单个通道进入区域能力集
  37. smartNoRecord.GET("channels/1/calibrations/regionEntrance", is.GetSizeRe) //获取侦测目标的尺寸
  38. smart.PUT("channels/1/calibrations/regionEntrance", is.PutSizeRe)
  39. smartNoRecord.GET("regionEntrance/1", is.GetRegionEntrance) //获取单个通道进入区域侦测规则
  40. smart.PUT("regionEntrance/1", is.PutRegionEntrance) //配置单个通道进入区域侦测规则
  41. }
  42. }