swagger.json 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469
  1. {
  2. "swagger": "2.0",
  3. "info": {
  4. "description": "This is a gateway server. On the page, you can go to do testing for every API.",
  5. "title": "Project access-control-monitor's APIs",
  6. "contact": {},
  7. "license": {},
  8. "version": "1.1"
  9. },
  10. "paths": {
  11. "/api/v1/attendance": {
  12. "put": {
  13. "description": "上传考勤数据",
  14. "consumes": [
  15. "application/json"
  16. ],
  17. "produces": [
  18. "application/json"
  19. ],
  20. "tags": [
  21. "user"
  22. ],
  23. "summary": "上传考勤数据",
  24. "parameters": [
  25. {
  26. "description": "上传考勤数据",
  27. "name": "body",
  28. "in": "body",
  29. "required": true,
  30. "schema": {
  31. "$ref": "#/definitions/v1.AttendanceRequest"
  32. }
  33. }
  34. ],
  35. "responses": {
  36. "200": {
  37. "description": "OK",
  38. "schema": {
  39. "$ref": "#/definitions/v1.AttendanceResponse"
  40. }
  41. },
  42. "500": {
  43. "description": "Internal Server Error",
  44. "schema": {
  45. "$ref": "#/definitions/base.HTTPError"
  46. }
  47. }
  48. }
  49. }
  50. },
  51. "/api/v1/auth": {
  52. "put": {
  53. "description": "授权获取key",
  54. "consumes": [
  55. "application/json"
  56. ],
  57. "produces": [
  58. "application/json"
  59. ],
  60. "tags": [
  61. "user"
  62. ],
  63. "summary": "授权获取key",
  64. "parameters": [
  65. {
  66. "description": "授权信息",
  67. "name": "body",
  68. "in": "body",
  69. "required": true,
  70. "schema": {
  71. "$ref": "#/definitions/v1.LoginBody"
  72. }
  73. }
  74. ],
  75. "responses": {
  76. "200": {
  77. "description": "OK",
  78. "schema": {
  79. "$ref": "#/definitions/v1.LoginResponse"
  80. }
  81. },
  82. "500": {
  83. "description": "Internal Server Error",
  84. "schema": {
  85. "$ref": "#/definitions/base.HTTPError"
  86. }
  87. }
  88. }
  89. }
  90. },
  91. "/api/v1/delete": {
  92. "put": {
  93. "description": "删除员工信息",
  94. "consumes": [
  95. "application/json"
  96. ],
  97. "produces": [
  98. "application/json"
  99. ],
  100. "tags": [
  101. "user"
  102. ],
  103. "summary": "删除员工信息",
  104. "parameters": [
  105. {
  106. "description": "删除人员",
  107. "name": "body",
  108. "in": "body",
  109. "required": true,
  110. "schema": {
  111. "$ref": "#/definitions/v1.StaffDeleteBody"
  112. }
  113. }
  114. ],
  115. "responses": {
  116. "200": {
  117. "description": "OK",
  118. "schema": {
  119. "$ref": "#/definitions/v1.StaffDeleteResp"
  120. }
  121. },
  122. "500": {
  123. "description": "Internal Server Error",
  124. "schema": {
  125. "$ref": "#/definitions/base.HTTPError"
  126. }
  127. }
  128. }
  129. }
  130. },
  131. "/api/v1/register": {
  132. "post": {
  133. "description": "上传员工信息",
  134. "consumes": [
  135. "application/json"
  136. ],
  137. "produces": [
  138. "application/json"
  139. ],
  140. "tags": [
  141. "user"
  142. ],
  143. "summary": "上传员工信息",
  144. "parameters": [
  145. {
  146. "description": "上传员工信息",
  147. "name": "body",
  148. "in": "body",
  149. "required": true,
  150. "schema": {
  151. "$ref": "#/definitions/v1.RegisterRequest"
  152. }
  153. }
  154. ],
  155. "responses": {
  156. "200": {
  157. "description": "OK",
  158. "schema": {
  159. "$ref": "#/definitions/v1.RegisterResponse"
  160. }
  161. },
  162. "500": {
  163. "description": "Internal Server Error",
  164. "schema": {
  165. "$ref": "#/definitions/base.HTTPError"
  166. }
  167. }
  168. }
  169. }
  170. },
  171. "/ping": {
  172. "put": {
  173. "description": "心跳",
  174. "consumes": [
  175. "application/json"
  176. ],
  177. "produces": [
  178. "application/json"
  179. ],
  180. "tags": [
  181. "heatbeat"
  182. ],
  183. "summary": "心跳",
  184. "parameters": [
  185. {
  186. "description": "sn",
  187. "name": "body",
  188. "in": "body",
  189. "required": true,
  190. "schema": {
  191. "$ref": "#/definitions/v1.PingBody"
  192. }
  193. }
  194. ],
  195. "responses": {
  196. "200": {
  197. "description": "OK",
  198. "schema": {
  199. "$ref": "#/definitions/v1.PingResponse"
  200. }
  201. },
  202. "500": {
  203. "description": "Internal Server Error",
  204. "schema": {
  205. "$ref": "#/definitions/base.HTTPError"
  206. }
  207. }
  208. }
  209. }
  210. }
  211. },
  212. "definitions": {
  213. "base.HTTPError": {
  214. "type": "object",
  215. "properties": {
  216. "code": {
  217. "type": "integer",
  218. "format": "int",
  219. "example": 500
  220. },
  221. "message": {
  222. "type": "string",
  223. "example": "status bad request"
  224. }
  225. }
  226. },
  227. "v1.AttendanceContent": {
  228. "type": "object",
  229. "required": [
  230. "is_in",
  231. "recog_time",
  232. "work_no"
  233. ],
  234. "properties": {
  235. "is_in": {
  236. "type": "integer"
  237. },
  238. "recog_time": {
  239. "type": "string"
  240. },
  241. "work_no": {
  242. "type": "string"
  243. }
  244. }
  245. },
  246. "v1.AttendanceRequest": {
  247. "type": "object",
  248. "required": [
  249. "content",
  250. "sn"
  251. ],
  252. "properties": {
  253. "content": {
  254. "description": "json 数组 Content 里面的内容用 des 加密 deskey: 对接的时候提供,\n加密前格式:\n{\n\"count\": 2,\n\"logs\":[\n{\"sn\": \"XXXX\",\"user_id\": \"XXXXX\",\"recog_time\":\n\"yyyy-Mm-dd HH:mm:SS\"},\n{\"sn\": \"XXXX\",\"user_id\": \"XXXXX\",\"recog_time\": \"yyyy-M\nm-dd HH:mm:SS\"}\n] }\nAppKey string `form:\"app_key\" json:\"app_key\" binding:\"required\"`",
  255. "type": "array",
  256. "items": {
  257. "$ref": "#/definitions/v1.AttendanceContent"
  258. }
  259. },
  260. "sn": {
  261. "type": "string"
  262. }
  263. }
  264. },
  265. "v1.AttendanceResponse": {
  266. "type": "object",
  267. "properties": {
  268. "code": {
  269. "description": "返回码",
  270. "type": "integer",
  271. "format": "int",
  272. "default": 0
  273. },
  274. "message": {
  275. "description": "消息",
  276. "type": "string",
  277. "default": "success"
  278. }
  279. }
  280. },
  281. "v1.LoginBody": {
  282. "type": "object",
  283. "required": [
  284. "sn"
  285. ],
  286. "properties": {
  287. "sn": {
  288. "type": "string"
  289. }
  290. }
  291. },
  292. "v1.LoginResp": {
  293. "type": "object",
  294. "properties": {
  295. "key": {
  296. "type": "string"
  297. }
  298. }
  299. },
  300. "v1.LoginResponse": {
  301. "type": "object",
  302. "properties": {
  303. "code": {
  304. "description": "返回码",
  305. "type": "integer",
  306. "format": "int",
  307. "default": 0
  308. },
  309. "data": {
  310. "type": "object",
  311. "$ref": "#/definitions/v1.LoginResp"
  312. },
  313. "message": {
  314. "description": "消息",
  315. "type": "string",
  316. "default": "success"
  317. }
  318. }
  319. },
  320. "v1.PingBody": {
  321. "type": "object",
  322. "required": [
  323. "sn"
  324. ],
  325. "properties": {
  326. "sn": {
  327. "type": "string"
  328. }
  329. }
  330. },
  331. "v1.PingResponse": {
  332. "type": "object",
  333. "properties": {
  334. "code": {
  335. "description": "返回码",
  336. "type": "integer",
  337. "format": "int",
  338. "default": 0
  339. },
  340. "message": {
  341. "description": "消息",
  342. "type": "string",
  343. "default": "success"
  344. }
  345. }
  346. },
  347. "v1.RegisterRequest": {
  348. "type": "object",
  349. "required": [
  350. "address",
  351. "birthday",
  352. "gender",
  353. "group",
  354. "id_cert",
  355. "id_issue",
  356. "id_period",
  357. "id_photo",
  358. "inf_photo",
  359. "labor_company",
  360. "name",
  361. "phone",
  362. "photo",
  363. "sn",
  364. "staff_type",
  365. "work_no",
  366. "work_type"
  367. ],
  368. "properties": {
  369. "address": {
  370. "type": "string"
  371. },
  372. "birthday": {
  373. "type": "string"
  374. },
  375. "gender": {
  376. "type": "integer"
  377. },
  378. "group": {
  379. "type": "string"
  380. },
  381. "id_cert": {
  382. "type": "string"
  383. },
  384. "id_issue": {
  385. "type": "string"
  386. },
  387. "id_period": {
  388. "type": "string"
  389. },
  390. "id_photo": {
  391. "type": "string"
  392. },
  393. "inf_photo": {
  394. "type": "string"
  395. },
  396. "labor_company": {
  397. "type": "string"
  398. },
  399. "name": {
  400. "type": "string"
  401. },
  402. "phone": {
  403. "type": "string"
  404. },
  405. "photo": {
  406. "type": "string"
  407. },
  408. "sn": {
  409. "type": "string"
  410. },
  411. "staff_type": {
  412. "type": "integer"
  413. },
  414. "work_no": {
  415. "description": "AppKey string `form:\"app_key\" json:\"app_key\" binding:\"required\"`",
  416. "type": "string"
  417. },
  418. "work_type": {
  419. "type": "integer"
  420. }
  421. }
  422. },
  423. "v1.RegisterResponse": {
  424. "type": "object",
  425. "properties": {
  426. "code": {
  427. "description": "返回码",
  428. "type": "integer",
  429. "format": "int",
  430. "default": 0
  431. },
  432. "message": {
  433. "description": "消息",
  434. "type": "string",
  435. "default": "success"
  436. }
  437. }
  438. },
  439. "v1.StaffDeleteBody": {
  440. "type": "object",
  441. "required": [
  442. "sn",
  443. "work_nos"
  444. ],
  445. "properties": {
  446. "sn": {
  447. "type": "string"
  448. },
  449. "work_nos": {
  450. "type": "array",
  451. "items": {
  452. "type": "string"
  453. }
  454. }
  455. }
  456. },
  457. "v1.StaffDeleteResp": {
  458. "type": "object",
  459. "properties": {
  460. "work_nos": {
  461. "type": "array",
  462. "items": {
  463. "type": "string"
  464. }
  465. }
  466. }
  467. }
  468. }
  469. }