docs.go 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032
  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. "version": "{{.Version}}"
  19. },
  20. "host": "{{.Host}}",
  21. "basePath": "{{.BasePath}}",
  22. "paths": {
  23. "/base/getContentList": {
  24. "get": {
  25. "consumes": [
  26. "application/json"
  27. ],
  28. "produces": [
  29. "application/json"
  30. ],
  31. "tags": [
  32. "Base"
  33. ],
  34. "summary": "获取类容列表",
  35. "parameters": [
  36. {
  37. "type": "integer",
  38. "description": "页码",
  39. "name": "page",
  40. "in": "query"
  41. },
  42. {
  43. "type": "integer",
  44. "description": "每页大小",
  45. "name": "pageSize",
  46. "in": "query"
  47. },
  48. {
  49. "type": "string",
  50. "description": "类型(norm 评测标准 banner 轮播 bulletin 公告)",
  51. "name": "type",
  52. "in": "query"
  53. }
  54. ],
  55. "responses": {
  56. "200": {
  57. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  58. "schema": {
  59. "type": "string"
  60. }
  61. }
  62. }
  63. }
  64. },
  65. "/base/loginwx": {
  66. "post": {
  67. "produces": [
  68. "application/json"
  69. ],
  70. "tags": [
  71. "Base"
  72. ],
  73. "summary": "用户登录",
  74. "parameters": [
  75. {
  76. "description": "code",
  77. "name": "data",
  78. "in": "body",
  79. "required": true,
  80. "schema": {
  81. "$ref": "#/definitions/request.LoginWx"
  82. }
  83. }
  84. ],
  85. "responses": {
  86. "200": {
  87. "description": "{\"success\":true,\"data\":{},\"msg\":\"登陆成功\"}",
  88. "schema": {
  89. "type": "string"
  90. }
  91. }
  92. }
  93. }
  94. },
  95. "/base/register": {
  96. "post": {
  97. "produces": [
  98. "application/json"
  99. ],
  100. "tags": [
  101. "Base"
  102. ],
  103. "summary": "用户申请登陆",
  104. "parameters": [
  105. {
  106. "description": "用户名, 昵称,手机号,openid ",
  107. "name": "data",
  108. "in": "body",
  109. "required": true,
  110. "schema": {
  111. "$ref": "#/definitions/request.Register"
  112. }
  113. }
  114. ],
  115. "responses": {
  116. "200": {
  117. "description": "{\"success\":true,\"data\":{},\"msg\":\"登陆成功\"}",
  118. "schema": {
  119. "type": "string"
  120. }
  121. }
  122. }
  123. }
  124. },
  125. "/place/createPlace": {
  126. "post": {
  127. "security": [
  128. {
  129. "ApiKeyAuth": []
  130. }
  131. ],
  132. "produces": [
  133. "application/json"
  134. ],
  135. "tags": [
  136. "Place"
  137. ],
  138. "summary": "站点添加",
  139. "parameters": [
  140. {
  141. "description": "站点名称, 站点定位,站点类型,站点区域 ",
  142. "name": "data",
  143. "in": "body",
  144. "required": true,
  145. "schema": {
  146. "$ref": "#/definitions/request.Place"
  147. }
  148. }
  149. ],
  150. "responses": {
  151. "200": {
  152. "description": "{\"success\":true,\"data\":{},\"msg\":\"创建成功\"}",
  153. "schema": {
  154. "type": "string"
  155. }
  156. }
  157. }
  158. }
  159. },
  160. "/sysDictionary/findSysDictionary": {
  161. "get": {
  162. "security": [
  163. {
  164. "ApiKeyAuth": []
  165. }
  166. ],
  167. "consumes": [
  168. "application/json"
  169. ],
  170. "produces": [
  171. "application/json"
  172. ],
  173. "tags": [
  174. "Dict"
  175. ],
  176. "summary": "获取字典",
  177. "parameters": [
  178. {
  179. "type": "string",
  180. "description": "字典类型(部门列表 department 站点类型 site_type 问题列表 site_1 1为站点类型的值)",
  181. "name": "type",
  182. "in": "query"
  183. },
  184. ],
  185. "responses": {
  186. "200": {
  187. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  188. "schema": {
  189. "type": "string"
  190. }
  191. }
  192. }
  193. }
  194. },
  195. "/place/deletePlace": {
  196. "delete": {
  197. "security": [
  198. {
  199. "ApiKeyAuth": []
  200. }
  201. ],
  202. "consumes": [
  203. "application/json"
  204. ],
  205. "produces": [
  206. "application/json"
  207. ],
  208. "tags": [
  209. "Place"
  210. ],
  211. "summary": "根据id删除站点",
  212. "parameters": [
  213. {
  214. "description": "根据id删除站点",
  215. "name": "data",
  216. "in": "body",
  217. "required": true,
  218. "schema": {
  219. "$ref": "#/definitions/request.findByID"
  220. }
  221. }
  222. ],
  223. "responses": {
  224. "200": {
  225. "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}",
  226. "schema": {
  227. "type": "string"
  228. }
  229. }
  230. }
  231. }
  232. },
  233. "/place/findPlace": {
  234. "get": {
  235. "security": [
  236. {
  237. "ApiKeyAuth": []
  238. }
  239. ],
  240. "consumes": [
  241. "application/json"
  242. ],
  243. "produces": [
  244. "application/json"
  245. ],
  246. "tags": [
  247. "Place"
  248. ],
  249. "summary": "用id查询站点详情",
  250. "parameters": [
  251. {
  252. "type": "integer",
  253. "description": "id",
  254. "name": "ID",
  255. "in": "query"
  256. }
  257. ],
  258. "responses": {
  259. "200": {
  260. "description": "{\"success\":true,\"data\":{},\"msg\":\"查询成功\"}",
  261. "schema": {
  262. "type": "string"
  263. }
  264. }
  265. }
  266. }
  267. },
  268. "/place/updatePlace": {
  269. "put": {
  270. "security": [
  271. {
  272. "ApiKeyAuth": []
  273. }
  274. ],
  275. "consumes": [
  276. "application/json"
  277. ],
  278. "produces": [
  279. "application/json"
  280. ],
  281. "tags": [
  282. "Place"
  283. ],
  284. "summary": "更新站点信息",
  285. "parameters": [
  286. {
  287. "description": "更新站点信息",
  288. "name": "data",
  289. "in": "body",
  290. "required": true,
  291. "schema": {
  292. "$ref": "#/definitions/request.PlaceUpdate"
  293. }
  294. }
  295. ],
  296. "responses": {
  297. "200": {
  298. "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}",
  299. "schema": {
  300. "type": "string"
  301. }
  302. }
  303. }
  304. }
  305. },
  306. "/place/getPlaceList": {
  307. "get": {
  308. "security": [
  309. {
  310. "ApiKeyAuth": []
  311. }
  312. ],
  313. "consumes": [
  314. "application/json"
  315. ],
  316. "produces": [
  317. "application/json"
  318. ],
  319. "tags": [
  320. "Place"
  321. ],
  322. "summary": "获取站点列表",
  323. "parameters": [
  324. {
  325. "type": "integer",
  326. "description": "页码",
  327. "name": "page",
  328. "in": "query"
  329. },
  330. {
  331. "type": "integer",
  332. "description": "每页大小",
  333. "name": "pageSize",
  334. "in": "query"
  335. }
  336. ],
  337. "responses": {
  338. "200": {
  339. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  340. "schema": {
  341. "type": "string"
  342. }
  343. }
  344. }
  345. }
  346. },
  347. "/problemInfo/updateProblemInfo": {
  348. "put": {
  349. "security": [
  350. {
  351. "ApiKeyAuth": []
  352. }
  353. ],
  354. "consumes": [
  355. "application/json"
  356. ],
  357. "produces": [
  358. "application/json"
  359. ],
  360. "tags": [
  361. "ProblemInfo"
  362. ],
  363. "summary": "处理问题",
  364. "parameters": [
  365. {
  366. "description": "处理问题",
  367. "name": "data",
  368. "in": "body",
  369. "required": true,
  370. "schema": {
  371. "$ref": "#/definitions/request.ProblemInfoC"
  372. }
  373. }
  374. ],
  375. "responses": {
  376. "200": {
  377. "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}",
  378. "schema": {
  379. "type": "string"
  380. }
  381. }
  382. }
  383. }
  384. },
  385. "/problemInfo/createProblemInfo": {
  386. "post": {
  387. "security": [
  388. {
  389. "ApiKeyAuth": []
  390. }
  391. ],
  392. "produces": [
  393. "application/json"
  394. ],
  395. "tags": [
  396. "ProblemInfo"
  397. ],
  398. "summary": "发布问题",
  399. "parameters": [
  400. {
  401. "description": "发布问题",
  402. "name": "data",
  403. "in": "body",
  404. "required": true,
  405. "schema": {
  406. "$ref": "#/definitions/request.ProblemInfo"
  407. }
  408. }
  409. ],
  410. "responses": {
  411. "200": {
  412. "description": "{\"success\":true,\"data\":{},\"msg\":\"发布问题成功\"}",
  413. "schema": {
  414. "type": "string"
  415. }
  416. }
  417. }
  418. }
  419. },
  420. "/problemInfo/findProblemInfo": {
  421. "get": {
  422. "security": [
  423. {
  424. "ApiKeyAuth": []
  425. }
  426. ],
  427. "consumes": [
  428. "application/json"
  429. ],
  430. "produces": [
  431. "application/json"
  432. ],
  433. "tags": [
  434. "ProblemInfo"
  435. ],
  436. "summary": "用id查询问题详情",
  437. "parameters": [
  438. {
  439. "type": "integer",
  440. "description": "id",
  441. "name": "ID",
  442. "in": "query"
  443. }
  444. ],
  445. "responses": {
  446. "200": {
  447. "description": "{\"success\":true,\"data\":{},\"msg\":\"查询成功\"}",
  448. "schema": {
  449. "type": "string"
  450. }
  451. }
  452. }
  453. }
  454. },
  455. "/problemInfo/getProblemInfoList": {
  456. "get": {
  457. "security": [
  458. {
  459. "ApiKeyAuth": []
  460. }
  461. ],
  462. "consumes": [
  463. "application/json"
  464. ],
  465. "produces": [
  466. "application/json"
  467. ],
  468. "tags": [
  469. "ProblemInfo"
  470. ],
  471. "summary": "获取问题列表",
  472. "parameters": [
  473. {
  474. "type": "integer",
  475. "description": "页码",
  476. "name": "page",
  477. "in": "query"
  478. },
  479. {
  480. "type": "integer",
  481. "description": "每页大小",
  482. "name": "pageSize",
  483. "in": "query"
  484. },
  485. {
  486. "type": "string",
  487. "description": "状态(Untreated 未处理 Processed 已处理)",
  488. "name": "status",
  489. "in": "query"
  490. },
  491. {
  492. "type": "integer",
  493. "description": "发布人",
  494. "name": "oper",
  495. "in": "query"
  496. },
  497. {
  498. "type": "string",
  499. "description": "站点类型",
  500. "name": "siteType",
  501. "in": "query"
  502. }
  503. ],
  504. "responses": {
  505. "200": {
  506. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  507. "schema": {
  508. "type": "string"
  509. }
  510. }
  511. }
  512. }
  513. },
  514. "/content/createContent": {
  515. "post": {
  516. "security": [
  517. {
  518. "ApiKeyAuth": []
  519. }
  520. ],
  521. "produces": [
  522. "application/json"
  523. ],
  524. "tags": [
  525. "Content"
  526. ],
  527. "summary": "发布内容",
  528. "parameters": [
  529. {
  530. "description": "发布内容",
  531. "name": "data",
  532. "in": "body",
  533. "required": true,
  534. "schema": {
  535. "$ref": "#/definitions/request.Content"
  536. }
  537. }
  538. ],
  539. "responses": {
  540. "200": {
  541. "description": "{\"success\":true,\"data\":{},\"msg\":\"发布问题成功\"}",
  542. "schema": {
  543. "type": "string"
  544. }
  545. }
  546. }
  547. }
  548. },
  549. "/content/findContent": {
  550. "get": {
  551. "security": [
  552. {
  553. "ApiKeyAuth": []
  554. }
  555. ],
  556. "consumes": [
  557. "application/json"
  558. ],
  559. "produces": [
  560. "application/json"
  561. ],
  562. "tags": [
  563. "Content"
  564. ],
  565. "summary": "获取内容详情",
  566. "parameters": [
  567. {
  568. "type": "integer",
  569. "description": "id",
  570. "name": "ID",
  571. "in": "query"
  572. }
  573. ],
  574. "responses": {
  575. "200": {
  576. "description": "{\"success\":true,\"data\":{},\"msg\":\"查询成功\"}",
  577. "schema": {
  578. "type": "string"
  579. }
  580. }
  581. }
  582. }
  583. },
  584. "/content/getContentList": {
  585. "get": {
  586. "security": [
  587. {
  588. "ApiKeyAuth": []
  589. }
  590. ],
  591. "consumes": [
  592. "application/json"
  593. ],
  594. "produces": [
  595. "application/json"
  596. ],
  597. "tags": [
  598. "Content"
  599. ],
  600. "summary": "获取类容列表",
  601. "parameters": [
  602. {
  603. "type": "integer",
  604. "description": "页码",
  605. "name": "page",
  606. "in": "query"
  607. },
  608. {
  609. "type": "integer",
  610. "description": "每页大小",
  611. "name": "pageSize",
  612. "in": "query"
  613. },
  614. {
  615. "type": "string",
  616. "description": "类型(norm 评测标准 banner 轮播 bulletin 公告)",
  617. "name": "type",
  618. "in": "query"
  619. }
  620. ],
  621. "responses": {
  622. "200": {
  623. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  624. "schema": {
  625. "type": "string"
  626. }
  627. }
  628. }
  629. }
  630. },
  631. "/fileUploadAndDownload/upload": {
  632. "post": {
  633. "security": [
  634. {
  635. "ApiKeyAuth": []
  636. }
  637. ],
  638. "consumes": [
  639. "multipart/form-data"
  640. ],
  641. "produces": [
  642. "application/json"
  643. ],
  644. "tags": [
  645. "ExaFileUploadAndDownload"
  646. ],
  647. "summary": "上传文件示例",
  648. "parameters": [
  649. {
  650. "type": "file",
  651. "description": "上传文件示例",
  652. "name": "file",
  653. "in": "formData",
  654. "required": true
  655. }
  656. ],
  657. "responses": {
  658. "200": {
  659. "description": "{\"success\":true,\"data\":{},\"msg\":\"上传成功\"}",
  660. "schema": {
  661. "type": "string"
  662. }
  663. }
  664. }
  665. }
  666. },
  667. "/user/getUserInfo": {
  668. "get": {
  669. "security": [
  670. {
  671. "ApiKeyAuth": []
  672. }
  673. ],
  674. "consumes": [
  675. "application/json"
  676. ],
  677. "produces": [
  678. "application/json"
  679. ],
  680. "tags": [
  681. "SysUser"
  682. ],
  683. "summary": "获取用户信息",
  684. "responses": {
  685. "200": {
  686. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  687. "schema": {
  688. "type": "string"
  689. }
  690. }
  691. }
  692. }
  693. },
  694. "/user/setUserName": {
  695. "put": {
  696. "security": [
  697. {
  698. "ApiKeyAuth": []
  699. }
  700. ],
  701. "consumes": [
  702. "application/json"
  703. ],
  704. "produces": [
  705. "application/json"
  706. ],
  707. "tags": [
  708. "SysUser"
  709. ],
  710. "summary": "设置用户信息",
  711. "parameters": [
  712. {
  713. "description": "只用提交 ID, userName 就可以",
  714. "name": "data",
  715. "in": "body",
  716. "required": true,
  717. "schema": {
  718. "$ref": "#/definitions/system.SysUser"
  719. }
  720. }
  721. ],
  722. "responses": {
  723. "200": {
  724. "description": "{\"success\":true,\"data\":{},\"msg\":\"设置成功\"}",
  725. "schema": {
  726. "type": "string"
  727. }
  728. }
  729. }
  730. }
  731. }
  732. },
  733. "definitions": {
  734. "request.findByID": {
  735. "type": "object",
  736. "properties": {
  737. "id": {
  738. "type": "integer"
  739. }
  740. }
  741. },
  742. "request.LoginWx": {
  743. "type": "object",
  744. "properties": {
  745. "code": {
  746. "description": "登陆微信响应code",
  747. "type": "string"
  748. }
  749. }
  750. },
  751. "request.Place": {
  752. "type": "object",
  753. "properties": {
  754. "name": {
  755. "description": "站点名称",
  756. "type": "string"
  757. },
  758. "position": {
  759. "description": "站点定位",
  760. "type": "string"
  761. },
  762. "type": {
  763. "description": "站点类型",
  764. "type": "string"
  765. },
  766. "region": {
  767. "description": "站点区域",
  768. "type": "string"
  769. }
  770. }
  771. },
  772. "request.PlaceUpdate": {
  773. "type": "object",
  774. "properties": {
  775. "id": {
  776. "description": "主键ID",
  777. "type": "integer"
  778. },
  779. "name": {
  780. "description": "站点名称",
  781. "type": "string"
  782. },
  783. "position": {
  784. "description": "站点定位",
  785. "type": "string"
  786. },
  787. "type": {
  788. "description": "站点类型",
  789. "type": "string"
  790. },
  791. "region": {
  792. "description": "站点区域",
  793. "type": "string"
  794. }
  795. }
  796. },
  797. "request.ProblemInfo": {
  798. "type": "object",
  799. "properties": {
  800. "imgs": {
  801. "description": "问题图片(多图用|分割)",
  802. "type": "string"
  803. },
  804. "remark": {
  805. "description": "问题备注",
  806. "type": "string"
  807. },
  808. "video": {
  809. "description": "问题视频",
  810. "type": "string"
  811. },
  812. "siteId": {
  813. "description": "站点id",
  814. "type": "string"
  815. },
  816. "matter": {
  817. "description": "问题ids(用|分割)",
  818. "type": "string"
  819. },
  820. "department": {
  821. "description": "责任部门",
  822. "type": "string"
  823. }
  824. }
  825. },
  826. "request.ProblemInfoC": {
  827. "type": "object",
  828. "properties": {
  829. "ID": {
  830. "description": "问题ID",
  831. "type": "string"
  832. },
  833. "handler": {
  834. "description": "当前登陆人ID",
  835. "type": "string"
  836. },
  837. "status": {
  838. "description": "处理状态改为(Processed)",
  839. "type": "string"
  840. },
  841. "handText": {
  842. "description": "处理内容",
  843. "type": "string"
  844. },
  845. "handImgs": {
  846. "description": "处理图片(多图用|隔开)",
  847. "type": "string"
  848. },
  849. "imgs": {
  850. "description": "问题图片(多图用|分割)",
  851. "type": "string"
  852. },
  853. "video": {
  854. "description": "问题视频",
  855. "type": "string"
  856. },
  857. "siteId": {
  858. "description": "站点id",
  859. "type": "string"
  860. },
  861. "matter": {
  862. "description": "问题ids(用|分割)",
  863. "type": "string"
  864. },
  865. "department": {
  866. "description": "责任部门",
  867. "type": "string"
  868. }
  869. }
  870. },
  871. "request.Content": {
  872. "type": "object",
  873. "properties": {
  874. "oper": {
  875. "description": "发布人",
  876. "type": "string"
  877. },
  878. "title": {
  879. "description": "标题",
  880. "type": "string"
  881. },
  882. "subtitle": {
  883. "description": "副标题(仅公告可用)",
  884. "type": "string"
  885. },
  886. "text": {
  887. "description": "内容",
  888. "type": "string"
  889. },
  890. "imgs": {
  891. "description": "图片(多图用|分割)",
  892. "type": "string"
  893. },
  894. "type": {
  895. "description": "类型(bulletin 公告|norm 评测标准|banner 首页轮播)",
  896. "type": "string"
  897. }
  898. }
  899. },
  900. "request.Register": {
  901. "type": "object",
  902. "properties": {
  903. "nickName": {
  904. "description": "微信昵称",
  905. "type": "string"
  906. },
  907. "openId": {
  908. "description": "openId",
  909. "type": "string"
  910. },
  911. "headerImg": {
  912. "description": "微信头像",
  913. "type": "string"
  914. },
  915. "username": {
  916. "description": "手机号",
  917. "type": "string"
  918. }
  919. }
  920. },
  921. "system.SysUser": {
  922. "type": "object",
  923. "properties": {
  924. "activeColor": {
  925. "description": "活跃颜色",
  926. "type": "string"
  927. },
  928. "authorityId": {
  929. "description": "用户角色ID",
  930. "type": "string"
  931. },
  932. "baseColor": {
  933. "description": "基础颜色",
  934. "type": "string"
  935. },
  936. "createdAt": {
  937. "description": "创建时间",
  938. "type": "string"
  939. },
  940. "headerImg": {
  941. "description": "用户头像",
  942. "type": "string"
  943. },
  944. "ID": {
  945. "description": "主键ID",
  946. "type": "integer"
  947. },
  948. "nickName": {
  949. "description": "用户昵称",
  950. "type": "string"
  951. },
  952. "sideMode": {
  953. "description": "用户侧边主题",
  954. "type": "string"
  955. },
  956. "updatedAt": {
  957. "description": "更新时间",
  958. "type": "string"
  959. },
  960. "userName": {
  961. "description": "用户名",
  962. "type": "string"
  963. },
  964. "uuid": {
  965. "description": "用户UUID",
  966. "type": "string"
  967. }
  968. }
  969. },
  970. },
  971. "securityDefinitions": {
  972. "ApiKeyAuth": {
  973. "type": "apiKey",
  974. "name": "x-token",
  975. "in": "header"
  976. }
  977. }
  978. }`
  979. type swaggerInfo struct {
  980. Version string
  981. Host string
  982. BasePath string
  983. Schemes []string
  984. Title string
  985. Description string
  986. }
  987. // SwaggerInfo holds exported Swagger Info so clients can modify it
  988. var SwaggerInfo = swaggerInfo{
  989. Version: "0.0.1.txt",
  990. Host: "",
  991. BasePath: "/api/",
  992. Schemes: []string{},
  993. Title: "Swagger Example API",
  994. Description: "请求响应code 成功是0 未注册1 审核中2 错误是7",
  995. }
  996. type s struct{}
  997. func (s *s) ReadDoc() string {
  998. sInfo := SwaggerInfo
  999. sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1)
  1000. t, err := template.New("swagger_info").Funcs(template.FuncMap{
  1001. "marshal": func(v interface{}) string {
  1002. a, _ := json.Marshal(v)
  1003. return string(a)
  1004. },
  1005. }).Parse(doc)
  1006. if err != nil {
  1007. return doc
  1008. }
  1009. var tpl bytes.Buffer
  1010. if err := t.Execute(&tpl, sInfo); err != nil {
  1011. return doc
  1012. }
  1013. return tpl.String()
  1014. }
  1015. func init() {
  1016. swag.Register(swag.Name, &s{})
  1017. }