swagger.yaml 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  1. definitions:
  2. base.HTTPError:
  3. properties:
  4. code:
  5. example: 500
  6. format: int
  7. type: integer
  8. message:
  9. example: status bad request
  10. type: string
  11. type: object
  12. v1.AttendanceContent:
  13. properties:
  14. is_in:
  15. type: integer
  16. recog_time:
  17. type: string
  18. work_no:
  19. type: string
  20. required:
  21. - is_in
  22. - recog_time
  23. - work_no
  24. type: object
  25. v1.AttendanceRequest:
  26. properties:
  27. content:
  28. description: |-
  29. json 数组 Content 里面的内容用 des 加密 deskey: 对接的时候提供,
  30. 加密前格式:
  31. {
  32. "count": 2,
  33. "logs":[
  34. {"sn": "XXXX","user_id": "XXXXX","recog_time":
  35. "yyyy-Mm-dd HH:mm:SS"},
  36. {"sn": "XXXX","user_id": "XXXXX","recog_time": "yyyy-M
  37. m-dd HH:mm:SS"}
  38. ] }
  39. AppKey string `form:"app_key" json:"app_key" binding:"required"`
  40. items:
  41. $ref: '#/definitions/v1.AttendanceContent'
  42. type: array
  43. sn:
  44. type: string
  45. required:
  46. - content
  47. - sn
  48. type: object
  49. v1.AttendanceResponse:
  50. properties:
  51. code:
  52. default: 0
  53. description: 返回码
  54. format: int
  55. type: integer
  56. message:
  57. default: success
  58. description: 消息
  59. type: string
  60. type: object
  61. v1.LoginBody:
  62. properties:
  63. sn:
  64. type: string
  65. required:
  66. - sn
  67. type: object
  68. v1.LoginResp:
  69. properties:
  70. key:
  71. type: string
  72. type: object
  73. v1.LoginResponse:
  74. properties:
  75. code:
  76. default: 0
  77. description: 返回码
  78. format: int
  79. type: integer
  80. data:
  81. $ref: '#/definitions/v1.LoginResp'
  82. type: object
  83. message:
  84. default: success
  85. description: 消息
  86. type: string
  87. type: object
  88. v1.PingBody:
  89. properties:
  90. sn:
  91. type: string
  92. required:
  93. - sn
  94. type: object
  95. v1.PingResponse:
  96. properties:
  97. code:
  98. default: 0
  99. description: 返回码
  100. format: int
  101. type: integer
  102. message:
  103. default: success
  104. description: 消息
  105. type: string
  106. type: object
  107. v1.RegisterRequest:
  108. properties:
  109. address:
  110. type: string
  111. birthday:
  112. type: string
  113. gender:
  114. type: integer
  115. group:
  116. type: string
  117. id_cert:
  118. type: string
  119. id_issue:
  120. type: string
  121. id_period:
  122. type: string
  123. id_photo:
  124. type: string
  125. inf_photo:
  126. type: string
  127. labor_company:
  128. type: string
  129. name:
  130. type: string
  131. phone:
  132. type: string
  133. photo:
  134. type: string
  135. sn:
  136. type: string
  137. staff_type:
  138. type: integer
  139. work_no:
  140. description: AppKey string `form:"app_key" json:"app_key" binding:"required"`
  141. type: string
  142. work_type:
  143. type: integer
  144. required:
  145. - address
  146. - birthday
  147. - gender
  148. - group
  149. - id_cert
  150. - id_issue
  151. - id_period
  152. - id_photo
  153. - inf_photo
  154. - labor_company
  155. - name
  156. - phone
  157. - photo
  158. - sn
  159. - staff_type
  160. - work_no
  161. - work_type
  162. type: object
  163. v1.RegisterResponse:
  164. properties:
  165. code:
  166. default: 0
  167. description: 返回码
  168. format: int
  169. type: integer
  170. message:
  171. default: success
  172. description: 消息
  173. type: string
  174. type: object
  175. v1.StaffDeleteBody:
  176. properties:
  177. sn:
  178. type: string
  179. work_nos:
  180. items:
  181. type: string
  182. type: array
  183. required:
  184. - sn
  185. - work_nos
  186. type: object
  187. v1.StaffDeleteResp:
  188. properties:
  189. work_nos:
  190. items:
  191. type: string
  192. type: array
  193. type: object
  194. info:
  195. contact: {}
  196. description: This is a gateway server. On the page, you can go to do testing for every API.
  197. license: {}
  198. title: Project access-control-monitor's APIs
  199. version: "1.1"
  200. paths:
  201. /api/v1/attendance:
  202. put:
  203. consumes:
  204. - application/json
  205. description: 上传考勤数据
  206. parameters:
  207. - description: 上传考勤数据
  208. in: body
  209. name: body
  210. required: true
  211. schema:
  212. $ref: '#/definitions/v1.AttendanceRequest'
  213. produces:
  214. - application/json
  215. responses:
  216. "200":
  217. description: OK
  218. schema:
  219. $ref: '#/definitions/v1.AttendanceResponse'
  220. "500":
  221. description: Internal Server Error
  222. schema:
  223. $ref: '#/definitions/base.HTTPError'
  224. summary: 上传考勤数据
  225. tags:
  226. - user
  227. /api/v1/auth:
  228. put:
  229. consumes:
  230. - application/json
  231. description: 授权获取key
  232. parameters:
  233. - description: 授权信息
  234. in: body
  235. name: body
  236. required: true
  237. schema:
  238. $ref: '#/definitions/v1.LoginBody'
  239. produces:
  240. - application/json
  241. responses:
  242. "200":
  243. description: OK
  244. schema:
  245. $ref: '#/definitions/v1.LoginResponse'
  246. "500":
  247. description: Internal Server Error
  248. schema:
  249. $ref: '#/definitions/base.HTTPError'
  250. summary: 授权获取key
  251. tags:
  252. - user
  253. /api/v1/delete:
  254. put:
  255. consumes:
  256. - application/json
  257. description: 删除员工信息
  258. parameters:
  259. - description: 删除人员
  260. in: body
  261. name: body
  262. required: true
  263. schema:
  264. $ref: '#/definitions/v1.StaffDeleteBody'
  265. produces:
  266. - application/json
  267. responses:
  268. "200":
  269. description: OK
  270. schema:
  271. $ref: '#/definitions/v1.StaffDeleteResp'
  272. "500":
  273. description: Internal Server Error
  274. schema:
  275. $ref: '#/definitions/base.HTTPError'
  276. summary: 删除员工信息
  277. tags:
  278. - user
  279. /api/v1/register:
  280. post:
  281. consumes:
  282. - application/json
  283. description: 上传员工信息
  284. parameters:
  285. - description: 上传员工信息
  286. in: body
  287. name: body
  288. required: true
  289. schema:
  290. $ref: '#/definitions/v1.RegisterRequest'
  291. produces:
  292. - application/json
  293. responses:
  294. "200":
  295. description: OK
  296. schema:
  297. $ref: '#/definitions/v1.RegisterResponse'
  298. "500":
  299. description: Internal Server Error
  300. schema:
  301. $ref: '#/definitions/base.HTTPError'
  302. summary: 上传员工信息
  303. tags:
  304. - user
  305. /ping:
  306. put:
  307. consumes:
  308. - application/json
  309. description: 心跳
  310. parameters:
  311. - description: sn
  312. in: body
  313. name: body
  314. required: true
  315. schema:
  316. $ref: '#/definitions/v1.PingBody'
  317. produces:
  318. - application/json
  319. responses:
  320. "200":
  321. description: OK
  322. schema:
  323. $ref: '#/definitions/v1.PingResponse'
  324. "500":
  325. description: Internal Server Error
  326. schema:
  327. $ref: '#/definitions/base.HTTPError'
  328. summary: 心跳
  329. tags:
  330. - heatbeat
  331. swagger: "2.0"