control.go 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. // Copyright 2019 github.com. All rights reserved.
  2. // Use of this source code is governed by github.com.
  3. package v1
  4. import (
  5. "access-control-monitor/param/base"
  6. )
  7. // 登录接口
  8. type LoginBody struct {
  9. Sn string `form:"sn" json:"sn" binding:"required"`
  10. }
  11. type LoginRequest struct {
  12. LoginBody
  13. }
  14. type LoginResp struct {
  15. Key string `json:"key"`
  16. }
  17. type LoginResponse struct {
  18. base.Result
  19. Data LoginResp `json:"data"`
  20. }
  21. // 人员上传接口
  22. type RegisterBody struct {
  23. Sn string `form:"sn" json:"sn" binding:"required"`
  24. WorkNo string `form:"work_no" json:"work_no"`
  25. CorpCode string `form:"corp_code" json:"corp_code"`
  26. CorpName string `form:"corp_name" json:"corp_name"`
  27. TeamSysNo int `form:"team_sys_no" json:"team_sys_no"`
  28. TeamName string `form:"team_name" json:"team_name"`
  29. WorkName string `form:"work_name" json:"work_name"`
  30. IsTeamLeader string `form:"is_team_leader" json:"is_team_leader"`
  31. IDCardType int `form:"id_card_type" json:"id_card_type"`
  32. IDCardNumber string `form:"id_card_number" json:"id_card_number"`
  33. Age int `form:"age" json:"age"`
  34. Gender string `form:"gender" json:"gender"`
  35. Nation int `form:"nation" json:"nation"`
  36. Address string `form:"address" json:"address"`
  37. HeadImage string `form:"head_image" json:"head_image"`
  38. PoliticsType int `form:"politics_type" json:"politics_type"`
  39. CultureLevelType int `form:"colture_level_type" json:"colture_level_type"`
  40. GrantOrg string `form:"grant_org" json:"grant_org"`
  41. WorkType string `form:"work_type" json:"work_type"`
  42. NativePlace string `form:"native_place" json:"native_place"`
  43. Mobile string `form:"mobile" json:"mobile"`
  44. HasContract string `form:"has_contract" json:"has_contract"`
  45. }
  46. type RegisterRequest struct {
  47. RegisterBody
  48. }
  49. type RegisterResponse struct {
  50. base.Result
  51. }
  52. // 删除员工信息
  53. type StaffDeleteBody struct {
  54. Sn string `form:"sn" json:"sn" binding:"required"`
  55. WorkNos []string `form:"work_nos" json:"work_nos" binding:"required"`
  56. //AppKey string `json:"app_key" form:"app_key" binding:"required"`
  57. }
  58. type StaffDeleteRequest struct {
  59. StaffDeleteBody
  60. }
  61. type StaffDeleteResp struct {
  62. WorkNos []string `json:"work_nos"`
  63. }
  64. type StaffDeleteResponse struct {
  65. base.Result
  66. //Data StaffDeleteResp `json:"data"`
  67. }
  68. type StaffUpdateRequest struct {
  69. RegisterBody
  70. }
  71. type StaffUpdateResponse struct {
  72. base.Result
  73. }
  74. // 上传识别结果
  75. type AttendanceBody struct {
  76. Sn string `form:"sn" json:"sn" binding:"required"`
  77. // json 数组 Content 里面的内容用 des 加密 deskey: 对接的时候提供,
  78. // 加密前格式:
  79. //{
  80. //"count": 2,
  81. //"logs":[
  82. //{"sn": "XXXX","user_id": "XXXXX","recog_time":
  83. //"yyyy-Mm-dd HH:mm:SS"},
  84. //{"sn": "XXXX","user_id": "XXXXX","recog_time": "yyyy-M
  85. //m-dd HH:mm:SS"}
  86. //] }
  87. //AppKey string `form:"app_key" json:"app_key" binding:"required"`
  88. TeamSysNo int `form:"team_sys_no" json:"team_sys_no"`
  89. TeamName string `form:"team_name" json:"team_name"`
  90. WorkName string `form:"work_name" json:"work_name"`
  91. IDCardType int `form:"id_card_type" json:"id_card_type"`
  92. IDCardNumber string `form:"id_card_number" json:"id_card_number"`
  93. Datetime string `form:"datetime" json:"datetime"`
  94. Direction int `form:"direction" json:"direction"`
  95. WorkNo string `form:"work_no" json:"work_no"`
  96. }
  97. type AttendanceRequest struct {
  98. AttendanceBody
  99. }
  100. type AttendanceResponse struct {
  101. base.Result
  102. }
  103. // 人员批量下发
  104. type BatchDownload struct {
  105. Name string `json:"name"`
  106. WorkNo string `json:"work_no"`
  107. IdCert string `json:"id_cert"`
  108. Photo string `json:"photo"`
  109. }
  110. type BatchDownloadQuery struct {
  111. Sn string `json:"sn" form:"sn" binding:"required"`
  112. //AppKey string `json:"app_key" form:"app_key" binding:"required"`
  113. }
  114. type BatchDownloadRequet struct {
  115. BatchDownloadQuery
  116. }
  117. type BatchDownloadResponse struct {
  118. base.Result
  119. Data []BatchDownload `json:"data"`
  120. }
  121. // 反馈接口
  122. type FeedBackBody struct {
  123. Sn string `form:"sn" json:"sn" binding:"required"`
  124. //AppKey string `form:"app_key" json:"app_key" binding:"required"`
  125. // 反馈类型:
  126. //0-人员删除成功,
  127. //1-人员删除失败,
  128. //2-人员下发成功,
  129. //3-人员下发失败
  130. Type int `form:"type" json:"type" binding:"required"`
  131. Msg string `form:"msg" json:"msg" binding:"required"`
  132. }
  133. type FeedBackRequet struct {
  134. FeedBackBody
  135. }
  136. type FeedBackResponse struct {
  137. // 返回类型: -3(反馈类型不能为空),-2(设备序
  138. //列号不存在), -1(服务器异常-失败), 0(空闲
  139. //-成功)
  140. base.Result
  141. }
  142. type PingRequest struct {
  143. PingBody
  144. }
  145. type PingBody struct {
  146. Sn string `form:"sn" json:"sn" binding:"required"`
  147. }
  148. type PingResponse struct {
  149. base.Result
  150. }
  151. type TeamInfoBody struct {
  152. Sn string `form:"sn" json:"sn"`
  153. TeamSysNo int `form:"team_sys_no" json:"team_sys_no"`
  154. CorpCode string `form:"corp_code" json:"corp_code"`
  155. CorpName string `form:"corp_name" json:"corp_name"`
  156. TeamName string `form:"team_name" json:"team_name"`
  157. TeamLeaderName string `form:"team_leader_name" json:"team_leader_name"`
  158. TeamLeaderPhone string `form:"team_leader_phone" json:"team_leader_phone"`
  159. Remark string `form:"remark" json:"remark"`
  160. }
  161. type TeamInfoRequest struct {
  162. TeamInfoBody
  163. }
  164. type TeamInfoResponse struct {
  165. base.Result
  166. }
  167. type TeamDeleteBody struct {
  168. Sn string `form:"sn" json:"sn"`
  169. TeamSysNos []int `form:"team_sys_nos" json:"team_sys_nos"`
  170. }
  171. type TeamDeleteRequest struct {
  172. TeamDeleteBody
  173. }
  174. type TeamDeleteResponse struct {
  175. base.Result
  176. }
  177. type TeamUpdateRequest struct {
  178. TeamInfoBody
  179. }
  180. type TeamUpdateResponse struct {
  181. base.Result
  182. }