common.go 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. package devices
  2. import (
  3. "mime/multipart"
  4. "server/dao"
  5. "server/model/common/request"
  6. )
  7. type SearchInfo struct {
  8. Page int `json:"page" form:"page"` // 页码
  9. PageSize int `json:"pageSize" form:"pageSize"` // 每页大小
  10. ProjectId uint `json:"projectId" form:"projectId"` //关键字1
  11. Sn string `json:"sn" form:"sn"` //关键字2
  12. }
  13. type ReqScreens struct {
  14. ID uint `json:"id"` //ID
  15. ScreensName string `json:"screensName"` //名称
  16. Sn string `json:"sn"` //设备sn
  17. ProjectId uint `json:"projectId"` //归属项目id
  18. IpAddress string `json:"ipAddress"` //ip地址
  19. Remark string `json:"remark"` //备注
  20. }
  21. type ProgramReq struct {
  22. DeviceSn string `json:"deviceSn"`
  23. Program dao.Program `json:"program"`
  24. }
  25. type SoundPeriodReq struct {
  26. DeviceSn string `json:"deviceSn"`
  27. SoundPeriod dao.SoundPeriod `json:"soundPeriod"`
  28. }
  29. type SetDisContent struct {
  30. Num string `json:"num"`
  31. Effect string `json:"effect"`
  32. Speed string `json:"speed"`
  33. Stay string `json:"stay"`
  34. Total string `json:"total"`
  35. Color string `json:"color"`
  36. Content string `json:"content"`
  37. }
  38. type DiscontentJSON struct {
  39. Setdiscontent0 SetDisContent `json:"setdiscontent0"`
  40. }
  41. type SetPeropdtime struct {
  42. Time string `json:"time"`
  43. Period0 dao.IntArray `json:"period0"`
  44. Period1 dao.IntArray `json:"period1"`
  45. Period2 dao.IntArray `json:"period2"`
  46. Period3 dao.IntArray `json:"period3"`
  47. Period4 dao.IntArray `json:"period4"`
  48. Period5 dao.IntArray `json:"period5"`
  49. Period6 dao.IntArray `json:"period6"`
  50. Period7 dao.IntArray `json:"period7"`
  51. }
  52. type PeriodtimeJSON struct {
  53. Setperiodtime0 SetPeropdtime `json:"setperiodtime0"`
  54. }
  55. type VoiceReq struct {
  56. DeviceSn string `json:"deviceSn"`
  57. Voice dao.Voice `json:"voice"`
  58. }
  59. type VoiceJSON struct {
  60. Audionumset0 SetVoice `json:"audionumset0"`
  61. }
  62. type SetVoice struct {
  63. Num0 string `json:"num0"`
  64. Num1 string `json:"num1"`
  65. Num2 string `json:"num2"`
  66. Num3 string `json:"num3"`
  67. Num4 string `json:"num4"`
  68. }
  69. type JSONForm struct {
  70. Sn string `json:"sn"`
  71. Json string `json:"json"`
  72. }
  73. // CameraEndianHeartbeatRequest 摄像头心跳
  74. type CameraEndianHeartbeatRequest struct {
  75. DevType string `json:"DevType"`
  76. DevName string `json:"DevName"`
  77. SerialNum string `json:"SerialNum"`
  78. LocalTime string `json:"LocalTime"`
  79. ReportCount int `json:"ReportCount"`
  80. }
  81. type CameraEndianHeartbeatResponse struct {
  82. ReturnCode int `json:"ReturnCode"`
  83. PushEventPic bool `json:"PushEventPic"`
  84. }
  85. // 摄像头推送 -------------------------------------------------------------------------------
  86. // 表单绑定结构体:对应 multipart/form-data 中的字段
  87. type CameraEventForm struct {
  88. // 匹配表单中的 "EventInfo" 字段(filename="EventInfo.json")
  89. // binding:"required" 表示该字段必填
  90. EventInfo *multipart.FileHeader `form:"EventInfo" binding:"required"`
  91. File *multipart.FileHeader `form:"file" binding:"omitempty"`
  92. }
  93. type CameraEndianEventRequest struct {
  94. DevType string `json:"DevType"`
  95. DevName string `json:"DevName"`
  96. SerialNum string `json:"SerialNum"`
  97. Channel int `json:"Channel"`
  98. ChannelName string `json:"ChannelName"`
  99. LocalTime string `json:"LocalTime"`
  100. EventType string `json:"EventType"`
  101. PersonInfo interface{} `json:"PersonInfo"`
  102. ElevatorInfo interface{} `json:"ElevatorInfo"`
  103. EbikeInfo interface{} `json:"EbikeInfo"`
  104. OverallImgInfo interface{} `json:"OverallImgInfo"`
  105. AlarmInfo interface{} `json:"AlarmInfo"`
  106. }
  107. type CameraEndianEventResponse struct {
  108. ReturnCode int `json:"ReturnCode"`
  109. }
  110. type SearchCamera struct {
  111. request.PageInfo
  112. }
  113. type SearchCaptureVehicles struct {
  114. request.PageInfo
  115. SLicense string `json:"sLicense"`
  116. VehicleType int `json:"vehicleType"`
  117. }