docs.go 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014
  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/log/list": {
  25. "get": {
  26. "description": "获取日志列表",
  27. "consumes": [
  28. "application/json"
  29. ],
  30. "produces": [
  31. "application/json"
  32. ],
  33. "tags": [
  34. "操作日志"
  35. ],
  36. "summary": "获取日志列表",
  37. "parameters": [
  38. {
  39. "type": "string",
  40. "description": "token",
  41. "name": "token",
  42. "in": "header",
  43. "required": true
  44. },
  45. {
  46. "type": "integer",
  47. "description": " ",
  48. "name": "page",
  49. "in": "query"
  50. },
  51. {
  52. "type": "integer",
  53. "description": " ",
  54. "name": "page_size",
  55. "in": "query"
  56. }
  57. ],
  58. "responses": {
  59. "200": {
  60. "description": "OK",
  61. "schema": {
  62. "$ref": "#/definitions/v1.SystemLogListResponse"
  63. }
  64. },
  65. "500": {
  66. "description": "Internal Server Error",
  67. "schema": {
  68. "$ref": "#/definitions/base.HTTPError"
  69. }
  70. }
  71. }
  72. }
  73. },
  74. "/api/v1/organization": {
  75. "put": {
  76. "description": "修改机构",
  77. "consumes": [
  78. "application/json"
  79. ],
  80. "produces": [
  81. "application/json"
  82. ],
  83. "tags": [
  84. "机构"
  85. ],
  86. "summary": "修改机构",
  87. "parameters": [
  88. {
  89. "type": "string",
  90. "description": "token",
  91. "name": "token",
  92. "in": "header",
  93. "required": true
  94. },
  95. {
  96. "description": "机构信息",
  97. "name": "body",
  98. "in": "body",
  99. "required": true,
  100. "schema": {
  101. "$ref": "#/definitions/v1.UpdateOrganizationBody"
  102. }
  103. }
  104. ],
  105. "responses": {
  106. "200": {
  107. "description": "OK",
  108. "schema": {
  109. "$ref": "#/definitions/v1.UpdateOrganizationResponse"
  110. }
  111. },
  112. "500": {
  113. "description": "Internal Server Error",
  114. "schema": {
  115. "$ref": "#/definitions/base.HTTPError"
  116. }
  117. }
  118. }
  119. },
  120. "post": {
  121. "description": "创建机构",
  122. "consumes": [
  123. "application/json"
  124. ],
  125. "produces": [
  126. "application/json"
  127. ],
  128. "tags": [
  129. "机构"
  130. ],
  131. "summary": "创建机构",
  132. "parameters": [
  133. {
  134. "type": "string",
  135. "description": "token",
  136. "name": "token",
  137. "in": "header",
  138. "required": true
  139. },
  140. {
  141. "description": "机构信息",
  142. "name": "body",
  143. "in": "body",
  144. "required": true,
  145. "schema": {
  146. "$ref": "#/definitions/v1.CreateOrganizationBody"
  147. }
  148. }
  149. ],
  150. "responses": {
  151. "200": {
  152. "description": "OK",
  153. "schema": {
  154. "$ref": "#/definitions/v1.CreateOrganizationResponse"
  155. }
  156. },
  157. "500": {
  158. "description": "Internal Server Error",
  159. "schema": {
  160. "$ref": "#/definitions/base.HTTPError"
  161. }
  162. }
  163. }
  164. }
  165. },
  166. "/api/v1/organization/list": {
  167. "get": {
  168. "description": "获取机构列表",
  169. "consumes": [
  170. "application/json"
  171. ],
  172. "produces": [
  173. "application/json"
  174. ],
  175. "tags": [
  176. "机构"
  177. ],
  178. "summary": "获取机构列表",
  179. "parameters": [
  180. {
  181. "type": "string",
  182. "description": "token",
  183. "name": "token",
  184. "in": "header",
  185. "required": true
  186. },
  187. {
  188. "type": "string",
  189. "description": "过滤",
  190. "name": "filter",
  191. "in": "query"
  192. },
  193. {
  194. "type": "integer",
  195. "description": " ",
  196. "name": "page",
  197. "in": "query"
  198. },
  199. {
  200. "type": "integer",
  201. "description": " ",
  202. "name": "page_size",
  203. "in": "query"
  204. }
  205. ],
  206. "responses": {
  207. "200": {
  208. "description": "OK",
  209. "schema": {
  210. "$ref": "#/definitions/v1.OrganizationListResponse"
  211. }
  212. },
  213. "500": {
  214. "description": "Internal Server Error",
  215. "schema": {
  216. "$ref": "#/definitions/base.HTTPError"
  217. }
  218. }
  219. }
  220. }
  221. },
  222. "/api/v1/organization/user": {
  223. "put": {
  224. "description": "修改机构超级管理员",
  225. "consumes": [
  226. "application/json"
  227. ],
  228. "produces": [
  229. "application/json"
  230. ],
  231. "tags": [
  232. "机构"
  233. ],
  234. "summary": "修改机构超级管理员",
  235. "parameters": [
  236. {
  237. "type": "string",
  238. "description": "token",
  239. "name": "token",
  240. "in": "header",
  241. "required": true
  242. },
  243. {
  244. "description": " ",
  245. "name": "body",
  246. "in": "body",
  247. "required": true,
  248. "schema": {
  249. "$ref": "#/definitions/v1.OrganizationUserUpdateBody"
  250. }
  251. }
  252. ],
  253. "responses": {
  254. "200": {
  255. "description": "OK",
  256. "schema": {
  257. "$ref": "#/definitions/v1.OrganizationUserUpdateResponse"
  258. }
  259. },
  260. "500": {
  261. "description": "Internal Server Error",
  262. "schema": {
  263. "$ref": "#/definitions/base.HTTPError"
  264. }
  265. }
  266. }
  267. },
  268. "post": {
  269. "description": "创建机构超级管理员",
  270. "consumes": [
  271. "application/json"
  272. ],
  273. "produces": [
  274. "application/json"
  275. ],
  276. "tags": [
  277. "机构"
  278. ],
  279. "summary": "创建机构超级管理员",
  280. "parameters": [
  281. {
  282. "type": "string",
  283. "description": "token",
  284. "name": "token",
  285. "in": "header",
  286. "required": true
  287. },
  288. {
  289. "description": "机构信息",
  290. "name": "body",
  291. "in": "body",
  292. "required": true,
  293. "schema": {
  294. "$ref": "#/definitions/v1.CreateOrganizationUserBody"
  295. }
  296. }
  297. ],
  298. "responses": {
  299. "200": {
  300. "description": "OK",
  301. "schema": {
  302. "$ref": "#/definitions/v1.CreateOrganizationUserResponse"
  303. }
  304. },
  305. "500": {
  306. "description": "Internal Server Error",
  307. "schema": {
  308. "$ref": "#/definitions/base.HTTPError"
  309. }
  310. }
  311. }
  312. }
  313. },
  314. "/api/v1/organization/user_list": {
  315. "get": {
  316. "description": "获取机构超级管理员列表",
  317. "consumes": [
  318. "application/json"
  319. ],
  320. "produces": [
  321. "application/json"
  322. ],
  323. "tags": [
  324. "机构"
  325. ],
  326. "summary": "获取机构超级管理员列表",
  327. "parameters": [
  328. {
  329. "type": "string",
  330. "description": "token",
  331. "name": "token",
  332. "in": "header",
  333. "required": true
  334. },
  335. {
  336. "type": "integer",
  337. "description": " ",
  338. "name": "page",
  339. "in": "query"
  340. },
  341. {
  342. "type": "integer",
  343. "description": " ",
  344. "name": "page_size",
  345. "in": "query"
  346. },
  347. {
  348. "type": "string",
  349. "description": "机构代码",
  350. "name": "organization_code",
  351. "in": "query",
  352. "required": true
  353. }
  354. ],
  355. "responses": {
  356. "200": {
  357. "description": "OK",
  358. "schema": {
  359. "$ref": "#/definitions/v1.OrganizationUserListResponse"
  360. }
  361. },
  362. "500": {
  363. "description": "Internal Server Error",
  364. "schema": {
  365. "$ref": "#/definitions/base.HTTPError"
  366. }
  367. }
  368. }
  369. }
  370. },
  371. "/api/v1/token_refresh": {
  372. "put": {
  373. "description": "刷新token",
  374. "consumes": [
  375. "application/json"
  376. ],
  377. "produces": [
  378. "application/json"
  379. ],
  380. "tags": [
  381. "用户"
  382. ],
  383. "summary": "刷新token",
  384. "parameters": [
  385. {
  386. "type": "string",
  387. "description": "token",
  388. "name": "token",
  389. "in": "header",
  390. "required": true
  391. }
  392. ],
  393. "responses": {
  394. "200": {
  395. "description": "OK",
  396. "schema": {
  397. "$ref": "#/definitions/v1.TokenResponse"
  398. }
  399. },
  400. "500": {
  401. "description": "Internal Server Error",
  402. "schema": {
  403. "$ref": "#/definitions/base.HTTPError"
  404. }
  405. }
  406. }
  407. }
  408. },
  409. "/api/v1/user/login": {
  410. "post": {
  411. "description": "登录",
  412. "consumes": [
  413. "application/json"
  414. ],
  415. "produces": [
  416. "application/json"
  417. ],
  418. "tags": [
  419. "用户"
  420. ],
  421. "summary": "登录",
  422. "parameters": [
  423. {
  424. "description": "登录信息",
  425. "name": "body",
  426. "in": "body",
  427. "required": true,
  428. "schema": {
  429. "$ref": "#/definitions/v1.LoginBody"
  430. }
  431. }
  432. ],
  433. "responses": {
  434. "200": {
  435. "description": "OK",
  436. "schema": {
  437. "$ref": "#/definitions/v1.LoginResponse"
  438. }
  439. },
  440. "500": {
  441. "description": "Internal Server Error",
  442. "schema": {
  443. "$ref": "#/definitions/base.HTTPError"
  444. }
  445. }
  446. }
  447. }
  448. },
  449. "/api/v1/user/password": {
  450. "put": {
  451. "description": "修改系统账号密码",
  452. "consumes": [
  453. "application/json"
  454. ],
  455. "produces": [
  456. "application/json"
  457. ],
  458. "tags": [
  459. "用户"
  460. ],
  461. "summary": "修改系统账号密码",
  462. "parameters": [
  463. {
  464. "type": "string",
  465. "description": "token",
  466. "name": "token",
  467. "in": "header",
  468. "required": true
  469. },
  470. {
  471. "description": " ",
  472. "name": "body",
  473. "in": "body",
  474. "required": true,
  475. "schema": {
  476. "$ref": "#/definitions/v1.ResetPasswdBody"
  477. }
  478. }
  479. ],
  480. "responses": {
  481. "200": {
  482. "description": "OK",
  483. "schema": {
  484. "$ref": "#/definitions/v1.ResetePasswdResponse"
  485. }
  486. },
  487. "500": {
  488. "description": "Internal Server Error",
  489. "schema": {
  490. "$ref": "#/definitions/base.HTTPError"
  491. }
  492. }
  493. }
  494. }
  495. }
  496. },
  497. "definitions": {
  498. "base.HTTPError": {
  499. "type": "object",
  500. "properties": {
  501. "code": {
  502. "type": "integer",
  503. "format": "int",
  504. "example": 500
  505. },
  506. "message": {
  507. "type": "string",
  508. "example": "status bad request"
  509. }
  510. }
  511. },
  512. "v1.CreateOrganizationBody": {
  513. "type": "object",
  514. "properties": {
  515. "is_disable": {
  516. "type": "boolean"
  517. },
  518. "month": {
  519. "type": "integer"
  520. },
  521. "organization_name": {
  522. "type": "string"
  523. }
  524. }
  525. },
  526. "v1.CreateOrganizationData": {
  527. "type": "object",
  528. "properties": {
  529. "organization_code": {
  530. "type": "string"
  531. }
  532. }
  533. },
  534. "v1.CreateOrganizationResponse": {
  535. "type": "object",
  536. "properties": {
  537. "code": {
  538. "description": "返回码",
  539. "type": "integer",
  540. "format": "int",
  541. "default": 0
  542. },
  543. "data": {
  544. "type": "object",
  545. "$ref": "#/definitions/v1.CreateOrganizationData"
  546. },
  547. "message": {
  548. "description": "消息",
  549. "type": "string",
  550. "default": "success"
  551. }
  552. }
  553. },
  554. "v1.CreateOrganizationUserBody": {
  555. "type": "object",
  556. "properties": {
  557. "email": {
  558. "type": "string"
  559. },
  560. "organization_code": {
  561. "type": "string"
  562. },
  563. "password": {
  564. "type": "string"
  565. },
  566. "phone": {
  567. "type": "string"
  568. },
  569. "username": {
  570. "type": "string"
  571. }
  572. }
  573. },
  574. "v1.CreateOrganizationUserReply": {
  575. "type": "object",
  576. "properties": {
  577. "uid": {
  578. "type": "integer"
  579. }
  580. }
  581. },
  582. "v1.CreateOrganizationUserResponse": {
  583. "type": "object",
  584. "properties": {
  585. "code": {
  586. "description": "返回码",
  587. "type": "integer",
  588. "format": "int",
  589. "default": 0
  590. },
  591. "data": {
  592. "type": "object",
  593. "$ref": "#/definitions/v1.CreateOrganizationUserReply"
  594. },
  595. "message": {
  596. "description": "消息",
  597. "type": "string",
  598. "default": "success"
  599. }
  600. }
  601. },
  602. "v1.LoginBody": {
  603. "type": "object",
  604. "properties": {
  605. "password": {
  606. "type": "string"
  607. },
  608. "user": {
  609. "type": "string"
  610. }
  611. }
  612. },
  613. "v1.LoginData": {
  614. "type": "object",
  615. "properties": {
  616. "token": {
  617. "type": "string"
  618. },
  619. "uid": {
  620. "type": "integer"
  621. },
  622. "user": {
  623. "type": "string"
  624. }
  625. }
  626. },
  627. "v1.LoginResponse": {
  628. "type": "object",
  629. "properties": {
  630. "code": {
  631. "description": "返回码",
  632. "type": "integer",
  633. "format": "int",
  634. "default": 0
  635. },
  636. "data": {
  637. "type": "object",
  638. "$ref": "#/definitions/v1.LoginData"
  639. },
  640. "message": {
  641. "description": "消息",
  642. "type": "string",
  643. "default": "success"
  644. }
  645. }
  646. },
  647. "v1.Organization": {
  648. "type": "object",
  649. "properties": {
  650. "end_time": {
  651. "type": "integer"
  652. },
  653. "is_disable": {
  654. "type": "boolean"
  655. },
  656. "is_expire": {
  657. "type": "boolean"
  658. },
  659. "key": {
  660. "type": "string"
  661. },
  662. "organization_code": {
  663. "type": "string"
  664. },
  665. "organization_name": {
  666. "type": "string"
  667. }
  668. }
  669. },
  670. "v1.OrganizationListReply": {
  671. "type": "object",
  672. "properties": {
  673. "list": {
  674. "type": "array",
  675. "items": {
  676. "$ref": "#/definitions/v1.Organization"
  677. }
  678. },
  679. "page": {
  680. "type": "integer"
  681. },
  682. "total": {
  683. "type": "integer"
  684. }
  685. }
  686. },
  687. "v1.OrganizationListResponse": {
  688. "type": "object",
  689. "properties": {
  690. "code": {
  691. "description": "返回码",
  692. "type": "integer",
  693. "format": "int",
  694. "default": 0
  695. },
  696. "data": {
  697. "type": "object",
  698. "$ref": "#/definitions/v1.OrganizationListReply"
  699. },
  700. "message": {
  701. "description": "消息",
  702. "type": "string",
  703. "default": "success"
  704. }
  705. }
  706. },
  707. "v1.OrganizationUserItem": {
  708. "type": "object",
  709. "properties": {
  710. "created_at": {
  711. "type": "string"
  712. },
  713. "email": {
  714. "type": "string"
  715. },
  716. "id": {
  717. "type": "integer"
  718. },
  719. "organization_code": {
  720. "type": "string"
  721. },
  722. "phone": {
  723. "type": "string"
  724. },
  725. "username": {
  726. "type": "string"
  727. }
  728. }
  729. },
  730. "v1.OrganizationUserListReply": {
  731. "type": "object",
  732. "properties": {
  733. "list": {
  734. "type": "array",
  735. "items": {
  736. "$ref": "#/definitions/v1.OrganizationUserItem"
  737. }
  738. },
  739. "page": {
  740. "type": "integer"
  741. },
  742. "total": {
  743. "type": "integer"
  744. }
  745. }
  746. },
  747. "v1.OrganizationUserListResponse": {
  748. "type": "object",
  749. "properties": {
  750. "code": {
  751. "description": "返回码",
  752. "type": "integer",
  753. "format": "int",
  754. "default": 0
  755. },
  756. "data": {
  757. "type": "object",
  758. "$ref": "#/definitions/v1.OrganizationUserListReply"
  759. },
  760. "message": {
  761. "description": "消息",
  762. "type": "string",
  763. "default": "success"
  764. }
  765. }
  766. },
  767. "v1.OrganizationUserUpdateBody": {
  768. "type": "object",
  769. "properties": {
  770. "email": {
  771. "type": "string"
  772. },
  773. "id": {
  774. "type": "integer"
  775. },
  776. "organization_code": {
  777. "type": "string"
  778. },
  779. "password": {
  780. "type": "string"
  781. },
  782. "phone": {
  783. "type": "string"
  784. },
  785. "username": {
  786. "type": "string"
  787. }
  788. }
  789. },
  790. "v1.OrganizationUserUpdateResponse": {
  791. "type": "object",
  792. "properties": {
  793. "code": {
  794. "description": "返回码",
  795. "type": "integer",
  796. "format": "int",
  797. "default": 0
  798. },
  799. "message": {
  800. "description": "消息",
  801. "type": "string",
  802. "default": "success"
  803. }
  804. }
  805. },
  806. "v1.ResetPasswdBody": {
  807. "type": "object",
  808. "properties": {
  809. "new": {
  810. "type": "string"
  811. },
  812. "old": {
  813. "type": "string"
  814. }
  815. }
  816. },
  817. "v1.ResetePasswdResponse": {
  818. "type": "object",
  819. "properties": {
  820. "code": {
  821. "description": "返回码",
  822. "type": "integer",
  823. "format": "int",
  824. "default": 0
  825. },
  826. "message": {
  827. "description": "消息",
  828. "type": "string",
  829. "default": "success"
  830. }
  831. }
  832. },
  833. "v1.SystemLogItem": {
  834. "type": "object",
  835. "properties": {
  836. "action": {
  837. "description": "行为",
  838. "type": "string"
  839. },
  840. "created_at": {
  841. "description": "时间",
  842. "type": "string"
  843. },
  844. "id": {
  845. "description": "日志id",
  846. "type": "integer"
  847. },
  848. "module": {
  849. "description": "模块",
  850. "type": "string"
  851. },
  852. "origin": {
  853. "description": "修改前信息",
  854. "type": "string"
  855. },
  856. "target": {
  857. "description": "修改后信息",
  858. "type": "string"
  859. },
  860. "uid": {
  861. "description": "账号id",
  862. "type": "integer"
  863. },
  864. "username": {
  865. "description": "账号名",
  866. "type": "string"
  867. }
  868. }
  869. },
  870. "v1.SystemLogListReply": {
  871. "type": "object",
  872. "properties": {
  873. "list": {
  874. "type": "array",
  875. "items": {
  876. "$ref": "#/definitions/v1.SystemLogItem"
  877. }
  878. },
  879. "page": {
  880. "type": "integer"
  881. },
  882. "total": {
  883. "type": "integer"
  884. }
  885. }
  886. },
  887. "v1.SystemLogListResponse": {
  888. "type": "object",
  889. "properties": {
  890. "code": {
  891. "description": "返回码",
  892. "type": "integer",
  893. "format": "int",
  894. "default": 0
  895. },
  896. "data": {
  897. "type": "object",
  898. "$ref": "#/definitions/v1.SystemLogListReply"
  899. },
  900. "message": {
  901. "description": "消息",
  902. "type": "string",
  903. "default": "success"
  904. }
  905. }
  906. },
  907. "v1.TokenResponse": {
  908. "type": "object",
  909. "properties": {
  910. "code": {
  911. "description": "返回码",
  912. "type": "integer",
  913. "format": "int",
  914. "default": 0
  915. },
  916. "data": {
  917. "type": "string"
  918. },
  919. "message": {
  920. "description": "消息",
  921. "type": "string",
  922. "default": "success"
  923. },
  924. "refresh_token": {
  925. "type": "string"
  926. }
  927. }
  928. },
  929. "v1.UpdateOrganizationBody": {
  930. "type": "object",
  931. "properties": {
  932. "is_disable": {
  933. "type": "boolean"
  934. },
  935. "month": {
  936. "type": "integer"
  937. },
  938. "organization_code": {
  939. "type": "string"
  940. },
  941. "organization_name": {
  942. "type": "string"
  943. }
  944. }
  945. },
  946. "v1.UpdateOrganizationResponse": {
  947. "type": "object",
  948. "properties": {
  949. "code": {
  950. "description": "返回码",
  951. "type": "integer",
  952. "format": "int",
  953. "default": 0
  954. },
  955. "message": {
  956. "description": "消息",
  957. "type": "string",
  958. "default": "success"
  959. }
  960. }
  961. }
  962. }
  963. }`
  964. type swaggerInfo struct {
  965. Version string
  966. Host string
  967. BasePath string
  968. Schemes []string
  969. Title string
  970. Description string
  971. }
  972. // SwaggerInfo holds exported Swagger Info so clients can modify it
  973. var SwaggerInfo = swaggerInfo{
  974. Version: "1.1",
  975. Host: "",
  976. BasePath: "",
  977. Schemes: []string{},
  978. Title: "Project cp-system-management-gateway's APIs",
  979. Description: "This is a gateway server. On the page, you can go to do testing for every API.",
  980. }
  981. type s struct{}
  982. func (s *s) ReadDoc() string {
  983. sInfo := SwaggerInfo
  984. sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1)
  985. t, err := template.New("swagger_info").Funcs(template.FuncMap{
  986. "marshal": func(v interface{}) string {
  987. a, _ := json.Marshal(v)
  988. return string(a)
  989. },
  990. }).Parse(doc)
  991. if err != nil {
  992. return doc
  993. }
  994. var tpl bytes.Buffer
  995. if err := t.Execute(&tpl, sInfo); err != nil {
  996. return doc
  997. }
  998. return tpl.String()
  999. }
  1000. func init() {
  1001. swag.Register(swag.Name, &s{})
  1002. }