gate.go 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. package v1
  2. import (
  3. "property-system-gateway/param/base"
  4. "property-system-gateway/pb/v1"
  5. )
  6. type GateUnitListQuery struct {
  7. DeviceId int64 `form:"device_id" json:"device_id"`
  8. }
  9. type GateUnitListRequest struct {
  10. base.Header
  11. GateUnitListQuery
  12. }
  13. type GateUnitBuildingUnitItem struct {
  14. UnitId int64 `json:"unit_id"`
  15. UnitNumber int64 `json:"unit_number"`
  16. UnitName string `json:"unit_name"`
  17. Selected bool `json:"selected"`
  18. }
  19. type GateUnitBuildingItem struct {
  20. BuildingNumber string `json:"building_number"`
  21. BuildingName string `json:"building_name"`
  22. Units []GateUnitBuildingUnitItem `json:"units"`
  23. }
  24. type GateUnitData struct {
  25. List []GateUnitBuildingItem `json:"list"`
  26. }
  27. type GateUnitListResponse struct {
  28. base.Result
  29. Data GateUnitData `json:"data"`
  30. }
  31. type GateUnitAddBody struct {
  32. DeviceId int64 `form:"device_id" json:"device_id"`
  33. UnitIds []int64 `form:"unit_ids" json:"unit_id"`
  34. }
  35. type GateUnitAddRequest struct {
  36. base.Header
  37. GateUnitAddBody
  38. }
  39. type GateUnitAddResponse struct {
  40. base.Result
  41. }
  42. type GateCardSyncBody struct {
  43. // 卡的记录id
  44. Id int64 `form:"id" json:"id"`
  45. }
  46. type GateCardSyncRequest struct {
  47. base.Header
  48. GateCardSyncBody
  49. }
  50. type GateCardSyncResponse struct {
  51. base.Result
  52. }
  53. type GateCardAddBody struct {
  54. CardNumber string `form:"card_number" json:"card_number"`
  55. Name string `form:"name" json:"name"`
  56. DeviceIds []int64 `form:"device_ids" json:"device_ids"`
  57. }
  58. type GateCardAddRequest struct {
  59. base.Header
  60. GateCardAddBody
  61. }
  62. type GateCardAddResponse struct {
  63. base.Result
  64. }
  65. type GateCardListQuery struct {
  66. DownStatus int32 `form:"down_status" json:"down_status"`
  67. Name string `form:"name" json:"name"`
  68. Page int64 `form:"page" json:"page"`
  69. PageSize int64 `form:"page_size" json:"page_size"`
  70. }
  71. type GateCardListRequest struct {
  72. base.Header
  73. GateCardListQuery
  74. }
  75. type GateCardListResponse struct {
  76. base.Result
  77. Data v1.GateCardListReply `json:"data"`
  78. }
  79. type GateCardCanBindDevicesQuery struct {
  80. CardNumber string `form:"card_number" json:"card_number"`
  81. }
  82. type GateCardCanBindDevicesRequest struct {
  83. base.Header
  84. GateCardCanBindDevicesQuery
  85. }
  86. type GateCardCanBindDevicesResponse struct {
  87. base.Result
  88. Data v1.GateCardCanBindDevicesReply `json:"data"`
  89. }
  90. type GateUserPicApproveBody struct {
  91. // 人脸记录id
  92. Id int64 `form:"id" json:"id"`
  93. Status bool `form:"status" json:"status"`
  94. Feedback string `form:"feedback" json:"feedback"`
  95. }
  96. type GateUserPicApproveRequest struct {
  97. base.Header
  98. GateUserPicApproveBody
  99. }
  100. type GateUserPicApproveResponse struct {
  101. base.Result
  102. }
  103. type GateUserPicSyncBody struct {
  104. // 人脸记录id
  105. Id int64 `form:"id" json:"id"`
  106. }
  107. type GateUserPicSyncRequest struct {
  108. base.Header
  109. GateUserPicSyncBody
  110. }
  111. type GateUserPicSyncResponse struct {
  112. base.Result
  113. }
  114. type GateUserPicListQuery struct {
  115. DownStatus int32 `form:"down_status" json:"down_status"`
  116. Name string `form:"name" json:"name"`
  117. Page int64 `form:"page" json:"page"`
  118. PageSize int64 `form:"page_size" json:"page_size"`
  119. }
  120. type GateUserPicListRequest struct {
  121. base.Header
  122. GateUserPicListQuery
  123. }
  124. type GateUserPicListResponse struct {
  125. base.Result
  126. Data v1.GateUserPicListReply `json:"data"`
  127. }
  128. type GateListQuery struct {
  129. Page int64 `form:"page" json:"page"`
  130. PageSize int64 `form:"page_size" json:"page_size"`
  131. Sn string `form:"sn"`
  132. Manufactor string `form:"manufactor"`
  133. DeviceName string `form:"device_name"`
  134. }
  135. type GateListRequest struct {
  136. base.Header
  137. GateListQuery
  138. }
  139. type GateListResponse struct {
  140. base.Result
  141. Data v1.GateListReply `json:"data"`
  142. }
  143. type GateEnableBody struct {
  144. DeviceId int64 `form:"device_id" json:"device_id"`
  145. // true 启用 false 停用
  146. Enable bool `form:"enable" json:"enable"`
  147. }
  148. type GateEnableRequest struct {
  149. base.Header
  150. GateEnableBody
  151. }
  152. type GateEnableResponse struct {
  153. base.Result
  154. }
  155. type GateSetBody struct {
  156. DeviceId int64 `form:"device_id" json:"device_id"`
  157. // 1 进场 2 出场 3 进出场
  158. Direction int32 `form:"direction" json:"direction"`
  159. // 位置
  160. Location string `form:"location" json:"location"`
  161. GateName string `form:"gate_name" json:"gate_name"`
  162. Ip string `form:"ip" json:"ip"`
  163. Mac string `form:"mac" json:"mac"`
  164. User string `form:"user" json:"user"`
  165. Password string `form:"password" json:"password"`
  166. }
  167. type GateSetRequest struct {
  168. base.Header
  169. GateSetBody
  170. }
  171. type GateSetResponse struct {
  172. base.Result
  173. }
  174. type GateOpenBody struct {
  175. DeviceId int64 `form:"device_id" json:"device_id"`
  176. }
  177. type GateOpenRequest struct {
  178. base.Header
  179. GateOpenBody
  180. }
  181. type GateOpenResponse struct {
  182. base.Result
  183. }
  184. type GateRestartBody struct {
  185. DeviceId int64 `form:"device_id" json:"device_id"`
  186. }
  187. type GateRestartRequest struct {
  188. base.Header
  189. GateRestartBody
  190. }
  191. type GateRestartResponse struct {
  192. base.Result
  193. }
  194. type GateCommandListQuery struct {
  195. Page int64 `form:"page" json:"page"`
  196. PageSize int64 `form:"page_size" json:"page_size"`
  197. DeviceId int64 `form:"device_id" json:"device_id"`
  198. }
  199. type GateCommandListRequest struct {
  200. base.Header
  201. GateCommandListQuery
  202. }
  203. type GateCommandListResponse struct {
  204. base.Result
  205. Data v1.GateCommandListReply `json:"data"`
  206. }
  207. type GateRecordListQuery struct {
  208. Page int64 `form:"page" json:"page"`
  209. PageSize int64 `form:"page_size" json:"page_size"`
  210. DeviceId string `form:"device_id" json:"device_id"`
  211. Start int64 `form:"start" json:"start"`
  212. End int64 `form:"end" json:"end"`
  213. IsVisitor int32 `form:"is_visitor" json:"is_visitor"`
  214. }
  215. type GateRecordListRequest struct {
  216. base.Header
  217. GateRecordListQuery
  218. }
  219. type GateRecordListResponse struct {
  220. base.Result
  221. Data v1.GateRecordListReply `json:"data"`
  222. }
  223. type GateVisitorListQuery struct {
  224. Page int64 `form:"page" json:"page"`
  225. PageSize int64 `form:"page_size" json:"page_size"`
  226. GateId int64 `form:"gate_id" json:"gate_id"`
  227. User string `form:"user"`
  228. Visitor string `form:"visitor"`
  229. Start int64 `form:"start"`
  230. End int64 `form:"end"`
  231. }
  232. type GateVisitorListRequest struct {
  233. base.Header
  234. GateVisitorListQuery
  235. }
  236. type GateVisitorListResponse struct {
  237. base.Result
  238. Data v1.GateVisitorListReply `json:"data"`
  239. }
  240. type GateCardDelQuery struct {
  241. Id int64 `form:"id" json:"id"`
  242. }
  243. type GateCardDelRequest struct {
  244. base.Header
  245. GateCardDelQuery
  246. }
  247. type GateCardDelResponse struct {
  248. base.Result
  249. }
  250. type GateUserPicDelQuery struct {
  251. Id int64 `form:"id" json:"id"`
  252. }
  253. type GateUserPicDelRequest struct {
  254. base.Header
  255. GateUserPicDelQuery
  256. }
  257. type GateUserPicDelResponse struct {
  258. base.Result
  259. }