swagger.json 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802
  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/staff": {
  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.RegisterBody"
  112. }
  113. }
  114. ],
  115. "responses": {
  116. "200": {
  117. "description": "OK",
  118. "schema": {
  119. "$ref": "#/definitions/v1.StaffUpdateResponse"
  120. }
  121. },
  122. "500": {
  123. "description": "Internal Server Error",
  124. "schema": {
  125. "$ref": "#/definitions/base.HTTPError"
  126. }
  127. }
  128. }
  129. },
  130. "post": {
  131. "description": "上传员工信息",
  132. "consumes": [
  133. "application/json"
  134. ],
  135. "produces": [
  136. "application/json"
  137. ],
  138. "tags": [
  139. "user"
  140. ],
  141. "summary": "上传员工信息",
  142. "parameters": [
  143. {
  144. "description": "上传员工信息",
  145. "name": "body",
  146. "in": "body",
  147. "required": true,
  148. "schema": {
  149. "$ref": "#/definitions/v1.RegisterRequest"
  150. }
  151. }
  152. ],
  153. "responses": {
  154. "200": {
  155. "description": "OK",
  156. "schema": {
  157. "$ref": "#/definitions/v1.RegisterResponse"
  158. }
  159. },
  160. "500": {
  161. "description": "Internal Server Error",
  162. "schema": {
  163. "$ref": "#/definitions/base.HTTPError"
  164. }
  165. }
  166. }
  167. }
  168. },
  169. "/api/v1/staff/del": {
  170. "put": {
  171. "description": "删除员工信息",
  172. "consumes": [
  173. "application/json"
  174. ],
  175. "produces": [
  176. "application/json"
  177. ],
  178. "tags": [
  179. "user"
  180. ],
  181. "summary": "删除员工信息",
  182. "parameters": [
  183. {
  184. "description": "删除人员",
  185. "name": "body",
  186. "in": "body",
  187. "required": true,
  188. "schema": {
  189. "$ref": "#/definitions/v1.StaffDeleteBody"
  190. }
  191. }
  192. ],
  193. "responses": {
  194. "200": {
  195. "description": "OK",
  196. "schema": {
  197. "$ref": "#/definitions/v1.StaffDeleteResp"
  198. }
  199. },
  200. "500": {
  201. "description": "Internal Server Error",
  202. "schema": {
  203. "$ref": "#/definitions/base.HTTPError"
  204. }
  205. }
  206. }
  207. }
  208. },
  209. "/api/v1/team": {
  210. "put": {
  211. "description": "更新班组信息",
  212. "consumes": [
  213. "application/json"
  214. ],
  215. "produces": [
  216. "application/json"
  217. ],
  218. "tags": [
  219. "user"
  220. ],
  221. "summary": "更新班组信息",
  222. "parameters": [
  223. {
  224. "description": "班组信息",
  225. "name": "body",
  226. "in": "body",
  227. "required": true,
  228. "schema": {
  229. "$ref": "#/definitions/v1.TeamInfoBody"
  230. }
  231. }
  232. ],
  233. "responses": {
  234. "200": {
  235. "description": "OK",
  236. "schema": {
  237. "$ref": "#/definitions/v1.TeamUpdateResponse"
  238. }
  239. },
  240. "500": {
  241. "description": "Internal Server Error",
  242. "schema": {
  243. "$ref": "#/definitions/base.HTTPError"
  244. }
  245. }
  246. }
  247. },
  248. "post": {
  249. "description": "上传班组信息",
  250. "consumes": [
  251. "application/json"
  252. ],
  253. "produces": [
  254. "application/json"
  255. ],
  256. "tags": [
  257. "user"
  258. ],
  259. "summary": "上传班组信息",
  260. "parameters": [
  261. {
  262. "description": "上传班组信息",
  263. "name": "body",
  264. "in": "body",
  265. "required": true,
  266. "schema": {
  267. "$ref": "#/definitions/v1.TeamInfoBody"
  268. }
  269. }
  270. ],
  271. "responses": {
  272. "200": {
  273. "description": "OK",
  274. "schema": {
  275. "$ref": "#/definitions/v1.TeamInfoResponse"
  276. }
  277. },
  278. "500": {
  279. "description": "Internal Server Error",
  280. "schema": {
  281. "$ref": "#/definitions/base.HTTPError"
  282. }
  283. }
  284. }
  285. }
  286. },
  287. "/api/v1/team/del": {
  288. "put": {
  289. "description": "删除班组信息",
  290. "consumes": [
  291. "application/json"
  292. ],
  293. "produces": [
  294. "application/json"
  295. ],
  296. "tags": [
  297. "user"
  298. ],
  299. "summary": "删除班组信息",
  300. "parameters": [
  301. {
  302. "description": " ",
  303. "name": "body",
  304. "in": "body",
  305. "required": true,
  306. "schema": {
  307. "$ref": "#/definitions/v1.TeamDeleteBody"
  308. }
  309. }
  310. ],
  311. "responses": {
  312. "200": {
  313. "description": "OK",
  314. "schema": {
  315. "$ref": "#/definitions/v1.TeamDeleteResponse"
  316. }
  317. },
  318. "500": {
  319. "description": "Internal Server Error",
  320. "schema": {
  321. "$ref": "#/definitions/base.HTTPError"
  322. }
  323. }
  324. }
  325. }
  326. },
  327. "/ping": {
  328. "put": {
  329. "description": "心跳",
  330. "consumes": [
  331. "application/json"
  332. ],
  333. "produces": [
  334. "application/json"
  335. ],
  336. "tags": [
  337. "heatbeat"
  338. ],
  339. "summary": "心跳",
  340. "parameters": [
  341. {
  342. "description": "sn",
  343. "name": "body",
  344. "in": "body",
  345. "required": true,
  346. "schema": {
  347. "$ref": "#/definitions/v1.PingBody"
  348. }
  349. }
  350. ],
  351. "responses": {
  352. "200": {
  353. "description": "OK",
  354. "schema": {
  355. "$ref": "#/definitions/v1.PingResponse"
  356. }
  357. },
  358. "500": {
  359. "description": "Internal Server Error",
  360. "schema": {
  361. "$ref": "#/definitions/base.HTTPError"
  362. }
  363. }
  364. }
  365. }
  366. }
  367. },
  368. "definitions": {
  369. "base.HTTPError": {
  370. "type": "object",
  371. "properties": {
  372. "code": {
  373. "type": "integer",
  374. "format": "int",
  375. "example": 500
  376. },
  377. "message": {
  378. "type": "string",
  379. "example": "status bad request"
  380. }
  381. }
  382. },
  383. "v1.AttendanceRequest": {
  384. "type": "object",
  385. "required": [
  386. "sn"
  387. ],
  388. "properties": {
  389. "datetime": {
  390. "type": "string"
  391. },
  392. "direction": {
  393. "type": "integer"
  394. },
  395. "id_card_number": {
  396. "type": "string"
  397. },
  398. "id_card_type": {
  399. "type": "integer"
  400. },
  401. "sn": {
  402. "type": "string"
  403. },
  404. "team_name": {
  405. "type": "string"
  406. },
  407. "team_sys_no": {
  408. "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\"`",
  409. "type": "integer"
  410. },
  411. "work_name": {
  412. "type": "string"
  413. },
  414. "work_no": {
  415. "type": "string"
  416. }
  417. }
  418. },
  419. "v1.AttendanceResponse": {
  420. "type": "object",
  421. "properties": {
  422. "code": {
  423. "description": "返回码",
  424. "type": "integer",
  425. "format": "int",
  426. "default": 0
  427. },
  428. "message": {
  429. "description": "消息",
  430. "type": "string",
  431. "default": "success"
  432. }
  433. }
  434. },
  435. "v1.LoginBody": {
  436. "type": "object",
  437. "required": [
  438. "sn"
  439. ],
  440. "properties": {
  441. "sn": {
  442. "type": "string"
  443. }
  444. }
  445. },
  446. "v1.LoginResp": {
  447. "type": "object",
  448. "properties": {
  449. "key": {
  450. "type": "string"
  451. }
  452. }
  453. },
  454. "v1.LoginResponse": {
  455. "type": "object",
  456. "properties": {
  457. "code": {
  458. "description": "返回码",
  459. "type": "integer",
  460. "format": "int",
  461. "default": 0
  462. },
  463. "data": {
  464. "type": "object",
  465. "$ref": "#/definitions/v1.LoginResp"
  466. },
  467. "message": {
  468. "description": "消息",
  469. "type": "string",
  470. "default": "success"
  471. }
  472. }
  473. },
  474. "v1.PingBody": {
  475. "type": "object",
  476. "required": [
  477. "sn"
  478. ],
  479. "properties": {
  480. "sn": {
  481. "type": "string"
  482. }
  483. }
  484. },
  485. "v1.PingResponse": {
  486. "type": "object",
  487. "properties": {
  488. "code": {
  489. "description": "返回码",
  490. "type": "integer",
  491. "format": "int",
  492. "default": 0
  493. },
  494. "message": {
  495. "description": "消息",
  496. "type": "string",
  497. "default": "success"
  498. }
  499. }
  500. },
  501. "v1.RegisterBody": {
  502. "type": "object",
  503. "required": [
  504. "sn"
  505. ],
  506. "properties": {
  507. "address": {
  508. "type": "string"
  509. },
  510. "age": {
  511. "type": "integer"
  512. },
  513. "colture_level_type": {
  514. "type": "integer"
  515. },
  516. "corp_code": {
  517. "type": "string"
  518. },
  519. "corp_name": {
  520. "type": "string"
  521. },
  522. "gender": {
  523. "type": "string"
  524. },
  525. "grant_org": {
  526. "type": "string"
  527. },
  528. "has_contract": {
  529. "type": "string"
  530. },
  531. "head_image": {
  532. "type": "string"
  533. },
  534. "id_card_number": {
  535. "type": "string"
  536. },
  537. "id_card_type": {
  538. "type": "integer"
  539. },
  540. "is_team_leader": {
  541. "type": "string"
  542. },
  543. "mobile": {
  544. "type": "string"
  545. },
  546. "nation": {
  547. "type": "integer"
  548. },
  549. "native_place": {
  550. "type": "string"
  551. },
  552. "politics_type": {
  553. "type": "integer"
  554. },
  555. "sn": {
  556. "type": "string"
  557. },
  558. "team_name": {
  559. "type": "string"
  560. },
  561. "team_sys_no": {
  562. "type": "integer"
  563. },
  564. "work_name": {
  565. "type": "string"
  566. },
  567. "work_no": {
  568. "type": "string"
  569. },
  570. "work_type": {
  571. "type": "string"
  572. }
  573. }
  574. },
  575. "v1.RegisterRequest": {
  576. "type": "object",
  577. "required": [
  578. "sn"
  579. ],
  580. "properties": {
  581. "address": {
  582. "type": "string"
  583. },
  584. "age": {
  585. "type": "integer"
  586. },
  587. "colture_level_type": {
  588. "type": "integer"
  589. },
  590. "corp_code": {
  591. "type": "string"
  592. },
  593. "corp_name": {
  594. "type": "string"
  595. },
  596. "gender": {
  597. "type": "string"
  598. },
  599. "grant_org": {
  600. "type": "string"
  601. },
  602. "has_contract": {
  603. "type": "string"
  604. },
  605. "head_image": {
  606. "type": "string"
  607. },
  608. "id_card_number": {
  609. "type": "string"
  610. },
  611. "id_card_type": {
  612. "type": "integer"
  613. },
  614. "is_team_leader": {
  615. "type": "string"
  616. },
  617. "mobile": {
  618. "type": "string"
  619. },
  620. "nation": {
  621. "type": "integer"
  622. },
  623. "native_place": {
  624. "type": "string"
  625. },
  626. "politics_type": {
  627. "type": "integer"
  628. },
  629. "sn": {
  630. "type": "string"
  631. },
  632. "team_name": {
  633. "type": "string"
  634. },
  635. "team_sys_no": {
  636. "type": "integer"
  637. },
  638. "work_name": {
  639. "type": "string"
  640. },
  641. "work_no": {
  642. "type": "string"
  643. },
  644. "work_type": {
  645. "type": "string"
  646. }
  647. }
  648. },
  649. "v1.RegisterResponse": {
  650. "type": "object",
  651. "properties": {
  652. "code": {
  653. "description": "返回码",
  654. "type": "integer",
  655. "format": "int",
  656. "default": 0
  657. },
  658. "message": {
  659. "description": "消息",
  660. "type": "string",
  661. "default": "success"
  662. }
  663. }
  664. },
  665. "v1.StaffDeleteBody": {
  666. "type": "object",
  667. "required": [
  668. "sn",
  669. "work_nos"
  670. ],
  671. "properties": {
  672. "sn": {
  673. "type": "string"
  674. },
  675. "work_nos": {
  676. "type": "array",
  677. "items": {
  678. "type": "string"
  679. }
  680. }
  681. }
  682. },
  683. "v1.StaffDeleteResp": {
  684. "type": "object",
  685. "properties": {
  686. "work_nos": {
  687. "type": "array",
  688. "items": {
  689. "type": "string"
  690. }
  691. }
  692. }
  693. },
  694. "v1.StaffUpdateResponse": {
  695. "type": "object",
  696. "properties": {
  697. "code": {
  698. "description": "返回码",
  699. "type": "integer",
  700. "format": "int",
  701. "default": 0
  702. },
  703. "message": {
  704. "description": "消息",
  705. "type": "string",
  706. "default": "success"
  707. }
  708. }
  709. },
  710. "v1.TeamDeleteBody": {
  711. "type": "object",
  712. "properties": {
  713. "sn": {
  714. "type": "string"
  715. },
  716. "team_sys_nos": {
  717. "type": "array",
  718. "items": {
  719. "type": "integer"
  720. }
  721. }
  722. }
  723. },
  724. "v1.TeamDeleteResponse": {
  725. "type": "object",
  726. "properties": {
  727. "code": {
  728. "description": "返回码",
  729. "type": "integer",
  730. "format": "int",
  731. "default": 0
  732. },
  733. "message": {
  734. "description": "消息",
  735. "type": "string",
  736. "default": "success"
  737. }
  738. }
  739. },
  740. "v1.TeamInfoBody": {
  741. "type": "object",
  742. "properties": {
  743. "corp_code": {
  744. "type": "string"
  745. },
  746. "corp_name": {
  747. "type": "string"
  748. },
  749. "remark": {
  750. "type": "string"
  751. },
  752. "sn": {
  753. "type": "string"
  754. },
  755. "team_leader_name": {
  756. "type": "string"
  757. },
  758. "team_leader_phone": {
  759. "type": "string"
  760. },
  761. "team_name": {
  762. "type": "string"
  763. },
  764. "team_sys_no": {
  765. "type": "integer"
  766. }
  767. }
  768. },
  769. "v1.TeamInfoResponse": {
  770. "type": "object",
  771. "properties": {
  772. "code": {
  773. "description": "返回码",
  774. "type": "integer",
  775. "format": "int",
  776. "default": 0
  777. },
  778. "message": {
  779. "description": "消息",
  780. "type": "string",
  781. "default": "success"
  782. }
  783. }
  784. },
  785. "v1.TeamUpdateResponse": {
  786. "type": "object",
  787. "properties": {
  788. "code": {
  789. "description": "返回码",
  790. "type": "integer",
  791. "format": "int",
  792. "default": 0
  793. },
  794. "message": {
  795. "description": "消息",
  796. "type": "string",
  797. "default": "success"
  798. }
  799. }
  800. }
  801. }
  802. }