docs.go 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866
  1. // GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
  2. // This file was generated by swaggo/swag
  3. package docs
  4. import (
  5. "bytes"
  6. "encoding/json"
  7. "strings"
  8. "github.com/alecthomas/template"
  9. "github.com/swaggo/swag"
  10. )
  11. var doc = `{
  12. "schemes": {{ marshal .Schemes }},
  13. "swagger": "2.0",
  14. "info": {
  15. "description": "{{.Description}}",
  16. "title": "{{.Title}}",
  17. "contact": {},
  18. "license": {},
  19. "version": "{{.Version}}"
  20. },
  21. "host": "{{.Host}}",
  22. "basePath": "{{.BasePath}}",
  23. "paths": {
  24. "/api/v1/attendance": {
  25. "put": {
  26. "description": "上传考勤数据",
  27. "consumes": [
  28. "application/json"
  29. ],
  30. "produces": [
  31. "application/json"
  32. ],
  33. "tags": [
  34. "user"
  35. ],
  36. "summary": "上传考勤数据",
  37. "parameters": [
  38. {
  39. "description": "上传考勤数据",
  40. "name": "body",
  41. "in": "body",
  42. "required": true,
  43. "schema": {
  44. "$ref": "#/definitions/v1.AttendanceRequest"
  45. }
  46. }
  47. ],
  48. "responses": {
  49. "200": {
  50. "description": "OK",
  51. "schema": {
  52. "$ref": "#/definitions/v1.AttendanceResponse"
  53. }
  54. },
  55. "500": {
  56. "description": "Internal Server Error",
  57. "schema": {
  58. "$ref": "#/definitions/base.HTTPError"
  59. }
  60. }
  61. }
  62. }
  63. },
  64. "/api/v1/auth": {
  65. "put": {
  66. "description": "授权获取key",
  67. "consumes": [
  68. "application/json"
  69. ],
  70. "produces": [
  71. "application/json"
  72. ],
  73. "tags": [
  74. "user"
  75. ],
  76. "summary": "授权获取key",
  77. "parameters": [
  78. {
  79. "description": "授权信息",
  80. "name": "body",
  81. "in": "body",
  82. "required": true,
  83. "schema": {
  84. "$ref": "#/definitions/v1.LoginBody"
  85. }
  86. }
  87. ],
  88. "responses": {
  89. "200": {
  90. "description": "OK",
  91. "schema": {
  92. "$ref": "#/definitions/v1.LoginResponse"
  93. }
  94. },
  95. "500": {
  96. "description": "Internal Server Error",
  97. "schema": {
  98. "$ref": "#/definitions/base.HTTPError"
  99. }
  100. }
  101. }
  102. }
  103. },
  104. "/api/v1/staff": {
  105. "put": {
  106. "description": "更新员工信息",
  107. "consumes": [
  108. "application/json"
  109. ],
  110. "produces": [
  111. "application/json"
  112. ],
  113. "tags": [
  114. "user"
  115. ],
  116. "summary": "更新员工信息",
  117. "parameters": [
  118. {
  119. "description": "上传员工信息",
  120. "name": "body",
  121. "in": "body",
  122. "required": true,
  123. "schema": {
  124. "$ref": "#/definitions/v1.RegisterBody"
  125. }
  126. }
  127. ],
  128. "responses": {
  129. "200": {
  130. "description": "OK",
  131. "schema": {
  132. "$ref": "#/definitions/v1.StaffUpdateResponse"
  133. }
  134. },
  135. "500": {
  136. "description": "Internal Server Error",
  137. "schema": {
  138. "$ref": "#/definitions/base.HTTPError"
  139. }
  140. }
  141. }
  142. },
  143. "post": {
  144. "description": "上传员工信息",
  145. "consumes": [
  146. "application/json"
  147. ],
  148. "produces": [
  149. "application/json"
  150. ],
  151. "tags": [
  152. "user"
  153. ],
  154. "summary": "上传员工信息",
  155. "parameters": [
  156. {
  157. "description": "上传员工信息",
  158. "name": "body",
  159. "in": "body",
  160. "required": true,
  161. "schema": {
  162. "$ref": "#/definitions/v1.RegisterRequest"
  163. }
  164. }
  165. ],
  166. "responses": {
  167. "200": {
  168. "description": "OK",
  169. "schema": {
  170. "$ref": "#/definitions/v1.RegisterResponse"
  171. }
  172. },
  173. "500": {
  174. "description": "Internal Server Error",
  175. "schema": {
  176. "$ref": "#/definitions/base.HTTPError"
  177. }
  178. }
  179. }
  180. }
  181. },
  182. "/api/v1/staff/del": {
  183. "put": {
  184. "description": "删除员工信息",
  185. "consumes": [
  186. "application/json"
  187. ],
  188. "produces": [
  189. "application/json"
  190. ],
  191. "tags": [
  192. "user"
  193. ],
  194. "summary": "删除员工信息",
  195. "parameters": [
  196. {
  197. "description": "删除人员",
  198. "name": "body",
  199. "in": "body",
  200. "required": true,
  201. "schema": {
  202. "$ref": "#/definitions/v1.StaffDeleteBody"
  203. }
  204. }
  205. ],
  206. "responses": {
  207. "200": {
  208. "description": "OK",
  209. "schema": {
  210. "$ref": "#/definitions/v1.StaffDeleteResp"
  211. }
  212. },
  213. "500": {
  214. "description": "Internal Server Error",
  215. "schema": {
  216. "$ref": "#/definitions/base.HTTPError"
  217. }
  218. }
  219. }
  220. }
  221. },
  222. "/api/v1/team": {
  223. "put": {
  224. "description": "更新班组信息",
  225. "consumes": [
  226. "application/json"
  227. ],
  228. "produces": [
  229. "application/json"
  230. ],
  231. "tags": [
  232. "user"
  233. ],
  234. "summary": "更新班组信息",
  235. "parameters": [
  236. {
  237. "description": "班组信息",
  238. "name": "body",
  239. "in": "body",
  240. "required": true,
  241. "schema": {
  242. "$ref": "#/definitions/v1.TeamInfoBody"
  243. }
  244. }
  245. ],
  246. "responses": {
  247. "200": {
  248. "description": "OK",
  249. "schema": {
  250. "$ref": "#/definitions/v1.TeamUpdateResponse"
  251. }
  252. },
  253. "500": {
  254. "description": "Internal Server Error",
  255. "schema": {
  256. "$ref": "#/definitions/base.HTTPError"
  257. }
  258. }
  259. }
  260. },
  261. "post": {
  262. "description": "上传班组信息",
  263. "consumes": [
  264. "application/json"
  265. ],
  266. "produces": [
  267. "application/json"
  268. ],
  269. "tags": [
  270. "user"
  271. ],
  272. "summary": "上传班组信息",
  273. "parameters": [
  274. {
  275. "description": "上传班组信息",
  276. "name": "body",
  277. "in": "body",
  278. "required": true,
  279. "schema": {
  280. "$ref": "#/definitions/v1.TeamInfoBody"
  281. }
  282. }
  283. ],
  284. "responses": {
  285. "200": {
  286. "description": "OK",
  287. "schema": {
  288. "$ref": "#/definitions/v1.TeamInfoResponse"
  289. }
  290. },
  291. "500": {
  292. "description": "Internal Server Error",
  293. "schema": {
  294. "$ref": "#/definitions/base.HTTPError"
  295. }
  296. }
  297. }
  298. }
  299. },
  300. "/api/v1/team/del": {
  301. "put": {
  302. "description": "删除班组信息",
  303. "consumes": [
  304. "application/json"
  305. ],
  306. "produces": [
  307. "application/json"
  308. ],
  309. "tags": [
  310. "user"
  311. ],
  312. "summary": "删除班组信息",
  313. "parameters": [
  314. {
  315. "description": " ",
  316. "name": "body",
  317. "in": "body",
  318. "required": true,
  319. "schema": {
  320. "$ref": "#/definitions/v1.TeamDeleteBody"
  321. }
  322. }
  323. ],
  324. "responses": {
  325. "200": {
  326. "description": "OK",
  327. "schema": {
  328. "$ref": "#/definitions/v1.TeamDeleteResponse"
  329. }
  330. },
  331. "500": {
  332. "description": "Internal Server Error",
  333. "schema": {
  334. "$ref": "#/definitions/base.HTTPError"
  335. }
  336. }
  337. }
  338. }
  339. },
  340. "/ping": {
  341. "put": {
  342. "description": "心跳",
  343. "consumes": [
  344. "application/json"
  345. ],
  346. "produces": [
  347. "application/json"
  348. ],
  349. "tags": [
  350. "heatbeat"
  351. ],
  352. "summary": "心跳",
  353. "parameters": [
  354. {
  355. "description": "sn",
  356. "name": "body",
  357. "in": "body",
  358. "required": true,
  359. "schema": {
  360. "$ref": "#/definitions/v1.PingBody"
  361. }
  362. }
  363. ],
  364. "responses": {
  365. "200": {
  366. "description": "OK",
  367. "schema": {
  368. "$ref": "#/definitions/v1.PingResponse"
  369. }
  370. },
  371. "500": {
  372. "description": "Internal Server Error",
  373. "schema": {
  374. "$ref": "#/definitions/base.HTTPError"
  375. }
  376. }
  377. }
  378. }
  379. }
  380. },
  381. "definitions": {
  382. "base.HTTPError": {
  383. "type": "object",
  384. "properties": {
  385. "code": {
  386. "type": "integer",
  387. "format": "int",
  388. "example": 500
  389. },
  390. "message": {
  391. "type": "string",
  392. "example": "status bad request"
  393. }
  394. }
  395. },
  396. "v1.AttendanceRequest": {
  397. "type": "object",
  398. "required": [
  399. "sn"
  400. ],
  401. "properties": {
  402. "datetime": {
  403. "type": "string"
  404. },
  405. "direction": {
  406. "type": "integer"
  407. },
  408. "id_card_number": {
  409. "type": "string"
  410. },
  411. "id_card_type": {
  412. "type": "integer"
  413. },
  414. "sn": {
  415. "type": "string"
  416. },
  417. "team_name": {
  418. "type": "string"
  419. },
  420. "team_sys_no": {
  421. "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\"` + "`" + `",
  422. "type": "integer"
  423. },
  424. "work_name": {
  425. "type": "string"
  426. },
  427. "work_no": {
  428. "type": "string"
  429. }
  430. }
  431. },
  432. "v1.AttendanceResponse": {
  433. "type": "object",
  434. "properties": {
  435. "code": {
  436. "description": "返回码",
  437. "type": "integer",
  438. "format": "int",
  439. "default": 0
  440. },
  441. "message": {
  442. "description": "消息",
  443. "type": "string",
  444. "default": "success"
  445. }
  446. }
  447. },
  448. "v1.LoginBody": {
  449. "type": "object",
  450. "required": [
  451. "sn"
  452. ],
  453. "properties": {
  454. "sn": {
  455. "type": "string"
  456. }
  457. }
  458. },
  459. "v1.LoginResp": {
  460. "type": "object",
  461. "properties": {
  462. "key": {
  463. "type": "string"
  464. }
  465. }
  466. },
  467. "v1.LoginResponse": {
  468. "type": "object",
  469. "properties": {
  470. "code": {
  471. "description": "返回码",
  472. "type": "integer",
  473. "format": "int",
  474. "default": 0
  475. },
  476. "data": {
  477. "type": "object",
  478. "$ref": "#/definitions/v1.LoginResp"
  479. },
  480. "message": {
  481. "description": "消息",
  482. "type": "string",
  483. "default": "success"
  484. }
  485. }
  486. },
  487. "v1.PingBody": {
  488. "type": "object",
  489. "required": [
  490. "sn"
  491. ],
  492. "properties": {
  493. "sn": {
  494. "type": "string"
  495. }
  496. }
  497. },
  498. "v1.PingResponse": {
  499. "type": "object",
  500. "properties": {
  501. "code": {
  502. "description": "返回码",
  503. "type": "integer",
  504. "format": "int",
  505. "default": 0
  506. },
  507. "message": {
  508. "description": "消息",
  509. "type": "string",
  510. "default": "success"
  511. }
  512. }
  513. },
  514. "v1.RegisterBody": {
  515. "type": "object",
  516. "required": [
  517. "sn"
  518. ],
  519. "properties": {
  520. "address": {
  521. "type": "string"
  522. },
  523. "age": {
  524. "type": "integer"
  525. },
  526. "colture_level_type": {
  527. "type": "integer"
  528. },
  529. "corp_code": {
  530. "type": "string"
  531. },
  532. "corp_name": {
  533. "type": "string"
  534. },
  535. "gender": {
  536. "type": "string"
  537. },
  538. "grant_org": {
  539. "type": "string"
  540. },
  541. "has_contract": {
  542. "type": "string"
  543. },
  544. "head_image": {
  545. "type": "string"
  546. },
  547. "id_card_number": {
  548. "type": "string"
  549. },
  550. "id_card_type": {
  551. "type": "integer"
  552. },
  553. "is_team_leader": {
  554. "type": "string"
  555. },
  556. "mobile": {
  557. "type": "string"
  558. },
  559. "nation": {
  560. "type": "integer"
  561. },
  562. "native_place": {
  563. "type": "string"
  564. },
  565. "politics_type": {
  566. "type": "integer"
  567. },
  568. "sn": {
  569. "type": "string"
  570. },
  571. "team_name": {
  572. "type": "string"
  573. },
  574. "team_sys_no": {
  575. "type": "integer"
  576. },
  577. "work_name": {
  578. "type": "string"
  579. },
  580. "work_no": {
  581. "type": "string"
  582. },
  583. "work_type": {
  584. "type": "string"
  585. }
  586. }
  587. },
  588. "v1.RegisterRequest": {
  589. "type": "object",
  590. "required": [
  591. "sn"
  592. ],
  593. "properties": {
  594. "address": {
  595. "type": "string"
  596. },
  597. "age": {
  598. "type": "integer"
  599. },
  600. "colture_level_type": {
  601. "type": "integer"
  602. },
  603. "corp_code": {
  604. "type": "string"
  605. },
  606. "corp_name": {
  607. "type": "string"
  608. },
  609. "gender": {
  610. "type": "string"
  611. },
  612. "grant_org": {
  613. "type": "string"
  614. },
  615. "has_contract": {
  616. "type": "string"
  617. },
  618. "head_image": {
  619. "type": "string"
  620. },
  621. "id_card_number": {
  622. "type": "string"
  623. },
  624. "id_card_type": {
  625. "type": "integer"
  626. },
  627. "is_team_leader": {
  628. "type": "string"
  629. },
  630. "mobile": {
  631. "type": "string"
  632. },
  633. "nation": {
  634. "type": "integer"
  635. },
  636. "native_place": {
  637. "type": "string"
  638. },
  639. "politics_type": {
  640. "type": "integer"
  641. },
  642. "sn": {
  643. "type": "string"
  644. },
  645. "team_name": {
  646. "type": "string"
  647. },
  648. "team_sys_no": {
  649. "type": "integer"
  650. },
  651. "work_name": {
  652. "type": "string"
  653. },
  654. "work_no": {
  655. "type": "string"
  656. },
  657. "work_type": {
  658. "type": "string"
  659. }
  660. }
  661. },
  662. "v1.RegisterResponse": {
  663. "type": "object",
  664. "properties": {
  665. "code": {
  666. "description": "返回码",
  667. "type": "integer",
  668. "format": "int",
  669. "default": 0
  670. },
  671. "message": {
  672. "description": "消息",
  673. "type": "string",
  674. "default": "success"
  675. }
  676. }
  677. },
  678. "v1.StaffDeleteBody": {
  679. "type": "object",
  680. "required": [
  681. "sn",
  682. "work_nos"
  683. ],
  684. "properties": {
  685. "sn": {
  686. "type": "string"
  687. },
  688. "work_nos": {
  689. "type": "array",
  690. "items": {
  691. "type": "string"
  692. }
  693. }
  694. }
  695. },
  696. "v1.StaffDeleteResp": {
  697. "type": "object",
  698. "properties": {
  699. "work_nos": {
  700. "type": "array",
  701. "items": {
  702. "type": "string"
  703. }
  704. }
  705. }
  706. },
  707. "v1.StaffUpdateResponse": {
  708. "type": "object",
  709. "properties": {
  710. "code": {
  711. "description": "返回码",
  712. "type": "integer",
  713. "format": "int",
  714. "default": 0
  715. },
  716. "message": {
  717. "description": "消息",
  718. "type": "string",
  719. "default": "success"
  720. }
  721. }
  722. },
  723. "v1.TeamDeleteBody": {
  724. "type": "object",
  725. "properties": {
  726. "sn": {
  727. "type": "string"
  728. },
  729. "team_sys_nos": {
  730. "type": "array",
  731. "items": {
  732. "type": "integer"
  733. }
  734. }
  735. }
  736. },
  737. "v1.TeamDeleteResponse": {
  738. "type": "object",
  739. "properties": {
  740. "code": {
  741. "description": "返回码",
  742. "type": "integer",
  743. "format": "int",
  744. "default": 0
  745. },
  746. "message": {
  747. "description": "消息",
  748. "type": "string",
  749. "default": "success"
  750. }
  751. }
  752. },
  753. "v1.TeamInfoBody": {
  754. "type": "object",
  755. "properties": {
  756. "corp_code": {
  757. "type": "string"
  758. },
  759. "corp_name": {
  760. "type": "string"
  761. },
  762. "remark": {
  763. "type": "string"
  764. },
  765. "sn": {
  766. "type": "string"
  767. },
  768. "team_leader_name": {
  769. "type": "string"
  770. },
  771. "team_leader_phone": {
  772. "type": "string"
  773. },
  774. "team_name": {
  775. "type": "string"
  776. },
  777. "team_sys_no": {
  778. "type": "integer"
  779. }
  780. }
  781. },
  782. "v1.TeamInfoResponse": {
  783. "type": "object",
  784. "properties": {
  785. "code": {
  786. "description": "返回码",
  787. "type": "integer",
  788. "format": "int",
  789. "default": 0
  790. },
  791. "message": {
  792. "description": "消息",
  793. "type": "string",
  794. "default": "success"
  795. }
  796. }
  797. },
  798. "v1.TeamUpdateResponse": {
  799. "type": "object",
  800. "properties": {
  801. "code": {
  802. "description": "返回码",
  803. "type": "integer",
  804. "format": "int",
  805. "default": 0
  806. },
  807. "message": {
  808. "description": "消息",
  809. "type": "string",
  810. "default": "success"
  811. }
  812. }
  813. }
  814. }
  815. }`
  816. type swaggerInfo struct {
  817. Version string
  818. Host string
  819. BasePath string
  820. Schemes []string
  821. Title string
  822. Description string
  823. }
  824. // SwaggerInfo holds exported Swagger Info so clients can modify it
  825. var SwaggerInfo = swaggerInfo{
  826. Version: "1.1",
  827. Host: "",
  828. BasePath: "",
  829. Schemes: []string{},
  830. Title: "Project access-control-monitor's APIs",
  831. Description: "This is a gateway server. On the page, you can go to do testing for every API.",
  832. }
  833. type s struct{}
  834. func (s *s) ReadDoc() string {
  835. sInfo := SwaggerInfo
  836. sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1)
  837. t, err := template.New("swagger_info").Funcs(template.FuncMap{
  838. "marshal": func(v interface{}) string {
  839. a, _ := json.Marshal(v)
  840. return string(a)
  841. },
  842. }).Parse(doc)
  843. if err != nil {
  844. return doc
  845. }
  846. var tpl bytes.Buffer
  847. if err := t.Execute(&tpl, sInfo); err != nil {
  848. return doc
  849. }
  850. return tpl.String()
  851. }
  852. func init() {
  853. swag.Register(swag.Name, &s{})
  854. }