docs.go 33 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003
  1. // GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
  2. // This file was generated by swaggo/swag at
  3. // 2022-06-22 15:11:48.7853794 +0800 CST m=+0.305982301
  4. package docs
  5. import (
  6. "bytes"
  7. "github.com/alecthomas/template"
  8. "github.com/swaggo/swag"
  9. )
  10. var doc = `{
  11. "swagger": "2.0",
  12. "info": {
  13. "description": "kptyun_service",
  14. "title": "科湃腾Go语言后台API",
  15. "contact": {
  16. "name": "朱红宾",
  17. "url": "https://www.dairyinfo.com.cn",
  18. "email": "kptzhu@163.com"
  19. },
  20. "license": {},
  21. "version": "1.1.2"
  22. },
  23. "basePath": "/",
  24. "paths": {
  25. "/auth": {
  26. "post": {
  27. "consumes": [
  28. "application/json"
  29. ],
  30. "produces": [
  31. "application/json"
  32. ],
  33. "tags": [
  34. "auth"
  35. ],
  36. "summary": "获取登录token 信息",
  37. "parameters": [
  38. {
  39. "type": "string",
  40. "description": "admin",
  41. "name": "username",
  42. "in": "formData",
  43. "required": true
  44. },
  45. {
  46. "type": "string",
  47. "description": "123456",
  48. "name": "password",
  49. "in": "formData",
  50. "required": true
  51. }
  52. ],
  53. "responses": {
  54. "200": {
  55. "description": "{ \"code\": 200e, \"data\": { \"token\": \"xxx\" }, \"msg\": \"ok\" }",
  56. "schema": {
  57. "type": "string"
  58. }
  59. },
  60. "400": {
  61. "description": "{\"code\":400, \"data\":null,\"msg\":\"请求参数错误\"}",
  62. "schema": {
  63. "type": "string"
  64. }
  65. },
  66. "404": {
  67. "description": "{ \"code\": 404, \"data\":null,\"msg\":\"请求参数错误\"}",
  68. "schema": {
  69. "type": "string"
  70. }
  71. }
  72. }
  73. }
  74. },
  75. "/authdata/GetRoleMenus": {
  76. "get": {
  77. "consumes": [
  78. "application/json"
  79. ],
  80. "produces": [
  81. "application/json"
  82. ],
  83. "tags": [
  84. "menu"
  85. ],
  86. "summary": "递归获取所有",
  87. "parameters": [
  88. {
  89. "type": "string",
  90. "description": "Ton",
  91. "name": "Ton",
  92. "in": "query",
  93. "required": true
  94. }
  95. ],
  96. "responses": {
  97. "200": {
  98. "description": "{ \"code\": 200, \"data\": {}, \"msg\": \"ok\" }",
  99. "schema": {
  100. "type": "string"
  101. }
  102. }
  103. }
  104. }
  105. },
  106. "/authdata/menus": {
  107. "get": {
  108. "consumes": [
  109. "application/json"
  110. ],
  111. "produces": [
  112. "application/json"
  113. ],
  114. "tags": [
  115. "menu"
  116. ],
  117. "summary": "获取所有菜单",
  118. "parameters": [
  119. {
  120. "type": "string",
  121. "description": "Ton",
  122. "name": "Ton",
  123. "in": "query",
  124. "required": true
  125. }
  126. ],
  127. "responses": {
  128. "200": {
  129. "description": "{ \"code\": 200, \"data\": {}, \"msg\": \"ok\" }",
  130. "schema": {
  131. "type": "string"
  132. }
  133. }
  134. }
  135. },
  136. "post": {
  137. "consumes": [
  138. "application/json"
  139. ],
  140. "produces": [
  141. "application/json"
  142. ],
  143. "tags": [
  144. "menu"
  145. ],
  146. "summary": "增加菜单",
  147. "parameters": [
  148. {
  149. "type": "string",
  150. "description": "name",
  151. "name": "name",
  152. "in": "query",
  153. "required": true
  154. },
  155. {
  156. "type": "string",
  157. "description": "path",
  158. "name": "path",
  159. "in": "query",
  160. "required": true
  161. }
  162. ],
  163. "responses": {
  164. "200": {
  165. "description": "{ \"code\": 200, \"data\": {}, \"msg\": \"ok\" }",
  166. "schema": {
  167. "type": "string"
  168. }
  169. }
  170. }
  171. }
  172. },
  173. "/authdata/menus/": {
  174. "get": {
  175. "consumes": [
  176. "application/json"
  177. ],
  178. "produces": [
  179. "application/json"
  180. ],
  181. "tags": [
  182. "menu"
  183. ],
  184. "summary": "获取单个菜单",
  185. "parameters": [
  186. {
  187. "type": "string",
  188. "description": "id",
  189. "name": "id",
  190. "in": "path",
  191. "required": true
  192. }
  193. ],
  194. "responses": {
  195. "200": {
  196. "description": "{ \"code\": 200, \"data\": {}, \"msg\": \"ok\" }",
  197. "schema": {
  198. "type": "string"
  199. }
  200. }
  201. }
  202. },
  203. "put": {
  204. "consumes": [
  205. "application/json"
  206. ],
  207. "produces": [
  208. "application/json"
  209. ],
  210. "tags": [
  211. "menu"
  212. ],
  213. "summary": "更新菜单",
  214. "parameters": [
  215. {
  216. "type": "string",
  217. "description": "id",
  218. "name": "id",
  219. "in": "path",
  220. "required": true
  221. },
  222. {
  223. "type": "string",
  224. "description": "name",
  225. "name": "name",
  226. "in": "query",
  227. "required": true
  228. },
  229. {
  230. "type": "string",
  231. "description": "path",
  232. "name": "path",
  233. "in": "query",
  234. "required": true
  235. },
  236. {
  237. "type": "string",
  238. "description": "method",
  239. "name": "method",
  240. "in": "query",
  241. "required": true
  242. }
  243. ],
  244. "responses": {
  245. "200": {
  246. "description": "{ \"code\": 200, \"data\": {}, \"msg\": \"ok\" }",
  247. "schema": {
  248. "type": "string"
  249. }
  250. }
  251. }
  252. },
  253. "delete": {
  254. "consumes": [
  255. "application/json"
  256. ],
  257. "produces": [
  258. "application/json"
  259. ],
  260. "tags": [
  261. "menu"
  262. ],
  263. "summary": "删除菜单",
  264. "parameters": [
  265. {
  266. "type": "string",
  267. "description": "id",
  268. "name": "id",
  269. "in": "path",
  270. "required": true
  271. }
  272. ],
  273. "responses": {
  274. "200": {
  275. "description": "{ \"code\": 200, \"data\": {}, \"msg\": \"ok\" }",
  276. "schema": {
  277. "type": "string"
  278. }
  279. }
  280. }
  281. }
  282. },
  283. "/authdata/roles": {
  284. "get": {
  285. "consumes": [
  286. "application/json"
  287. ],
  288. "produces": [
  289. "application/json"
  290. ],
  291. "tags": [
  292. "role"
  293. ],
  294. "summary": "获取所有角色",
  295. "responses": {
  296. "200": {
  297. "description": "{ \"code\": 200, \"data\": {}, \"msg\": \"ok\" }",
  298. "schema": {
  299. "type": "string"
  300. }
  301. }
  302. }
  303. },
  304. "post": {
  305. "consumes": [
  306. "application/json"
  307. ],
  308. "produces": [
  309. "application/json"
  310. ],
  311. "tags": [
  312. "role"
  313. ],
  314. "summary": "增加角色",
  315. "parameters": [
  316. {
  317. "type": "string",
  318. "description": "name",
  319. "name": "name",
  320. "in": "query",
  321. "required": true
  322. },
  323. {
  324. "type": "string",
  325. "description": "menu_id",
  326. "name": "menu_id",
  327. "in": "query",
  328. "required": true
  329. }
  330. ],
  331. "responses": {
  332. "200": {
  333. "description": "{ \"code\": 200, \"data\": {}, \"msg\": \"ok\" }",
  334. "schema": {
  335. "type": "string"
  336. }
  337. }
  338. }
  339. }
  340. },
  341. "/authdata/roles/": {
  342. "get": {
  343. "consumes": [
  344. "application/json"
  345. ],
  346. "produces": [
  347. "application/json"
  348. ],
  349. "tags": [
  350. "role"
  351. ],
  352. "summary": "获取单个角色",
  353. "parameters": [
  354. {
  355. "type": "string",
  356. "description": "id",
  357. "name": "id",
  358. "in": "path",
  359. "required": true
  360. }
  361. ],
  362. "responses": {
  363. "200": {
  364. "description": "{ \"code\": 200, \"data\": {}, \"msg\": \"ok\" }",
  365. "schema": {
  366. "type": "string"
  367. }
  368. }
  369. }
  370. },
  371. "put": {
  372. "consumes": [
  373. "application/json"
  374. ],
  375. "produces": [
  376. "application/json"
  377. ],
  378. "tags": [
  379. "role"
  380. ],
  381. "summary": "更新角色",
  382. "parameters": [
  383. {
  384. "type": "string",
  385. "description": "id",
  386. "name": "id",
  387. "in": "path",
  388. "required": true
  389. },
  390. {
  391. "type": "string",
  392. "description": "name",
  393. "name": "name",
  394. "in": "query",
  395. "required": true
  396. },
  397. {
  398. "type": "string",
  399. "description": "menu_id",
  400. "name": "menu_id",
  401. "in": "query",
  402. "required": true
  403. }
  404. ],
  405. "responses": {
  406. "200": {
  407. "description": "{ \"code\": 200, \"data\": {}, \"msg\": \"ok\" }",
  408. "schema": {
  409. "type": "string"
  410. }
  411. }
  412. }
  413. },
  414. "delete": {
  415. "consumes": [
  416. "application/json"
  417. ],
  418. "produces": [
  419. "application/json"
  420. ],
  421. "tags": [
  422. "role"
  423. ],
  424. "summary": "删除角色",
  425. "parameters": [
  426. {
  427. "type": "string",
  428. "description": "id",
  429. "name": "id",
  430. "in": "path",
  431. "required": true
  432. }
  433. ],
  434. "responses": {
  435. "200": {
  436. "description": "{ \"code\": 200, \"data\": {}, \"msg\": \"ok\" }",
  437. "schema": {
  438. "type": "string"
  439. }
  440. }
  441. }
  442. }
  443. },
  444. "/authdata/userinfo": {
  445. "get": {
  446. "consumes": [
  447. "application/json"
  448. ],
  449. "produces": [
  450. "application/json"
  451. ],
  452. "tags": [
  453. "users"
  454. ],
  455. "summary": "获取单个用户信息",
  456. "parameters": [
  457. {
  458. "type": "integer",
  459. "description": "iddd",
  460. "name": "id",
  461. "in": "path",
  462. "required": true
  463. }
  464. ],
  465. "responses": {
  466. "200": {
  467. "description": "{ \"code\": 200, \"data\": {}, \"msg\": \"ok\" }",
  468. "schema": {
  469. "type": "string"
  470. }
  471. }
  472. }
  473. }
  474. },
  475. "/data/GetDataByName": {
  476. "post": {
  477. "consumes": [
  478. "application/json"
  479. ],
  480. "produces": [
  481. "application/json"
  482. ],
  483. "tags": [
  484. "GetDataByName"
  485. ],
  486. "summary": "根据APISQL表中SQL执行得到数据集",
  487. "parameters": [
  488. {
  489. "description": "sqlname",
  490. "name": "sqlname",
  491. "in": "body",
  492. "required": true,
  493. "schema": {
  494. "type": "object",
  495. "$ref": "#/definitions/string"
  496. }
  497. },
  498. {
  499. "description": "offset",
  500. "name": "offset",
  501. "in": "body",
  502. "required": true,
  503. "schema": {
  504. "type": "object",
  505. "$ref": "#/definitions/int"
  506. }
  507. },
  508. {
  509. "description": "pagecount",
  510. "name": "pagecount",
  511. "in": "body",
  512. "required": true,
  513. "schema": {
  514. "type": "object",
  515. "$ref": "#/definitions/int"
  516. }
  517. },
  518. {
  519. "description": "returntype",
  520. "name": "returntype",
  521. "in": "body",
  522. "required": true,
  523. "schema": {
  524. "type": "object",
  525. "$ref": "#/definitions/string"
  526. }
  527. }
  528. ],
  529. "responses": {
  530. "200": {
  531. "description": "{ \"code\": 200, \"data\": {}, \"msg\": \"ok\" }",
  532. "schema": {
  533. "type": "string"
  534. }
  535. },
  536. "400": {
  537. "description": "{\"code\":400, \"data\":null,\"msg\":\"请求参数错误\"}",
  538. "schema": {
  539. "type": "string"
  540. }
  541. },
  542. "404": {
  543. "description": "{ \"code\": 404, \"data\":null,\"msg\":\"请求参数错误\"}",
  544. "schema": {
  545. "type": "string"
  546. }
  547. }
  548. }
  549. }
  550. },
  551. "/data/GetDataByNameForm": {
  552. "post": {
  553. "consumes": [
  554. "application/json"
  555. ],
  556. "produces": [
  557. "application/json"
  558. ],
  559. "tags": [
  560. "GetDataByNameForm"
  561. ],
  562. "summary": "根据APISQL表中SQL执行得到数据集",
  563. "parameters": [
  564. {
  565. "description": "sqlname",
  566. "name": "sqlname",
  567. "in": "body",
  568. "required": true,
  569. "schema": {
  570. "type": "object",
  571. "$ref": "#/definitions/json"
  572. }
  573. },
  574. {
  575. "type": "integer",
  576. "description": "offset",
  577. "name": "offset",
  578. "in": "query",
  579. "required": true
  580. },
  581. {
  582. "type": "integer",
  583. "description": "pagecount",
  584. "name": "pagecount",
  585. "in": "query",
  586. "required": true
  587. },
  588. {
  589. "type": "string",
  590. "description": "returntype",
  591. "name": "returntype",
  592. "in": "query",
  593. "required": true
  594. },
  595. {
  596. "type": "json",
  597. "description": "ss",
  598. "name": "s",
  599. "in": "formData",
  600. "required": true
  601. }
  602. ],
  603. "responses": {
  604. "200": {
  605. "description": "{ \"code\": 200, \"data\": {}, \"msg\": \"ok\" }",
  606. "schema": {
  607. "type": "string"
  608. }
  609. },
  610. "400": {
  611. "description": "{\"code\":400, \"data\":null,\"msg\":\"请求参数错误\"}",
  612. "schema": {
  613. "type": "string"
  614. }
  615. },
  616. "404": {
  617. "description": "{ \"code\": 404, \"data\":null,\"msg\":\"请求参数错误\"}",
  618. "schema": {
  619. "type": "string"
  620. }
  621. }
  622. }
  623. }
  624. },
  625. "/data/GetDataByNames": {
  626. "post": {
  627. "consumes": [
  628. "application/json"
  629. ],
  630. "produces": [
  631. "application/json"
  632. ],
  633. "tags": [
  634. "GetDataByNames"
  635. ],
  636. "summary": "根据APISQL表中SQL执行得到数据集",
  637. "parameters": [
  638. {
  639. "type": "integer",
  640. "description": "offset",
  641. "name": "offset",
  642. "in": "query",
  643. "required": true
  644. },
  645. {
  646. "type": "integer",
  647. "description": "pagecount",
  648. "name": "pagecount",
  649. "in": "query",
  650. "required": true
  651. },
  652. {
  653. "type": "string",
  654. "description": "returntype",
  655. "name": "returntype",
  656. "in": "query",
  657. "required": true
  658. }
  659. ],
  660. "responses": {
  661. "200": {
  662. "description": "{ \"code\": 200, \"data\": {}, \"msg\": \"ok\" }",
  663. "schema": {
  664. "type": "string"
  665. }
  666. },
  667. "400": {
  668. "description": "{\"code\":400, \"data\":null,\"msg\":\"请求参数错误\"}",
  669. "schema": {
  670. "type": "string"
  671. }
  672. },
  673. "404": {
  674. "description": "{ \"code\": 404, \"data\":null,\"msg\":\"请求参数错误\"}",
  675. "schema": {
  676. "type": "string"
  677. }
  678. }
  679. }
  680. }
  681. },
  682. "/data/ImportExcel": {
  683. "post": {
  684. "consumes": [
  685. "application/json"
  686. ],
  687. "produces": [
  688. "application/json"
  689. ],
  690. "tags": [
  691. "ImportExcel"
  692. ],
  693. "summary": "导入excel文件到数据库,excel第一行作为参数",
  694. "parameters": [
  695. {
  696. "type": "string",
  697. "description": "文件名",
  698. "name": "file",
  699. "in": "query",
  700. "required": true
  701. },
  702. {
  703. "type": "string",
  704. "description": "执行sql的名字",
  705. "name": "name",
  706. "in": "header",
  707. "required": true
  708. }
  709. ],
  710. "responses": {
  711. "200": {
  712. "description": "{ \"code\": 200, \"data\": {}, \"msg\": \"ok\" }",
  713. "schema": {
  714. "type": "string"
  715. }
  716. },
  717. "400": {
  718. "description": "{\"code\":400, \"data\":null,\"msg\":\"请求参数错误\"}",
  719. "schema": {
  720. "type": "string"
  721. }
  722. },
  723. "404": {
  724. "description": "{ \"code\": 404, \"data\":null,\"msg\":\"请求参数错误\"}",
  725. "schema": {
  726. "type": "string"
  727. }
  728. }
  729. }
  730. }
  731. },
  732. "/data/PostDataByName": {
  733. "post": {
  734. "consumes": [
  735. "application/json"
  736. ],
  737. "produces": [
  738. "application/json"
  739. ],
  740. "tags": [
  741. "PostDataByName"
  742. ],
  743. "summary": "根据APISQL表中SQL执行得到数据集",
  744. "parameters": [
  745. {
  746. "type": "string",
  747. "description": "sqlname",
  748. "name": "sqlname",
  749. "in": "query",
  750. "required": true
  751. },
  752. {
  753. "type": "integer",
  754. "description": "offset",
  755. "name": "offset",
  756. "in": "query",
  757. "required": true
  758. },
  759. {
  760. "type": "integer",
  761. "description": "pagecount",
  762. "name": "pagecount",
  763. "in": "query",
  764. "required": true
  765. },
  766. {
  767. "type": "string",
  768. "description": "returntype",
  769. "name": "returntype",
  770. "in": "query",
  771. "required": true
  772. }
  773. ],
  774. "responses": {
  775. "200": {
  776. "description": "{ \"code\": 200, \"data\": {}, \"msg\": \"ok\" }",
  777. "schema": {
  778. "type": "string"
  779. }
  780. },
  781. "400": {
  782. "description": "{\"code\":400, \"data\":null,\"msg\":\"请求参数错误\"}",
  783. "schema": {
  784. "type": "string"
  785. }
  786. },
  787. "404": {
  788. "description": "{ \"code\": 404, \"data\":null,\"msg\":\"请求参数错误\"}",
  789. "schema": {
  790. "type": "string"
  791. }
  792. }
  793. }
  794. }
  795. },
  796. "/data/PostDataByNameForm": {
  797. "post": {
  798. "consumes": [
  799. "application/json"
  800. ],
  801. "produces": [
  802. "application/json"
  803. ],
  804. "tags": [
  805. "PostDataByNameForm"
  806. ],
  807. "summary": "根据APISQL表中SQL执行得到数据集",
  808. "parameters": [
  809. {
  810. "type": "string",
  811. "description": "sqlname",
  812. "name": "sqlname",
  813. "in": "query",
  814. "required": true
  815. },
  816. {
  817. "type": "integer",
  818. "description": "offset",
  819. "name": "offset",
  820. "in": "query",
  821. "required": true
  822. },
  823. {
  824. "type": "integer",
  825. "description": "pagecount",
  826. "name": "pagecount",
  827. "in": "query",
  828. "required": true
  829. },
  830. {
  831. "type": "string",
  832. "description": "returntype",
  833. "name": "returntype",
  834. "in": "query",
  835. "required": true
  836. }
  837. ],
  838. "responses": {
  839. "200": {
  840. "description": "{ \"code\": 200, \"data\": {}, \"msg\": \"ok\" }",
  841. "schema": {
  842. "type": "string"
  843. }
  844. },
  845. "400": {
  846. "description": "{\"code\":400, \"data\":null,\"msg\":\"请求参数错误朱红彬彬\"}",
  847. "schema": {
  848. "type": "string"
  849. }
  850. },
  851. "404": {
  852. "description": "{ \"code\": 404, \"data\":null,\"msg\":\"请求参数错误\"}",
  853. "schema": {
  854. "type": "string"
  855. }
  856. }
  857. }
  858. }
  859. },
  860. "/data/PostDatasByName": {
  861. "post": {
  862. "consumes": [
  863. "application/json"
  864. ],
  865. "produces": [
  866. "application/json"
  867. ],
  868. "tags": [
  869. "PostDatasByName"
  870. ],
  871. "summary": "根据APISQL表中SQL执行得到数据集",
  872. "parameters": [
  873. {
  874. "type": "string",
  875. "description": "sqlname",
  876. "name": "sqlname",
  877. "in": "query",
  878. "required": true
  879. },
  880. {
  881. "type": "integer",
  882. "description": "offset",
  883. "name": "offset",
  884. "in": "query",
  885. "required": true
  886. },
  887. {
  888. "type": "integer",
  889. "description": "pagecount",
  890. "name": "pagecount",
  891. "in": "query",
  892. "required": true
  893. },
  894. {
  895. "type": "string",
  896. "description": "returntype",
  897. "name": "returntype",
  898. "in": "query",
  899. "required": true
  900. }
  901. ],
  902. "responses": {
  903. "200": {
  904. "description": "{ \"code\": 200, \"data\": {}, \"msg\": \"ok\" }",
  905. "schema": {
  906. "type": "string"
  907. }
  908. },
  909. "400": {
  910. "description": "{\"code\":400, \"data\":null,\"msg\":\"请求参数错误\"}",
  911. "schema": {
  912. "type": "string"
  913. }
  914. },
  915. "404": {
  916. "description": "{ \"code\": 404, \"data\":null,\"msg\":\"请求参数错误\"}",
  917. "schema": {
  918. "type": "string"
  919. }
  920. }
  921. }
  922. }
  923. },
  924. "/data/getdata": {
  925. "post": {
  926. "consumes": [
  927. "application/json"
  928. ],
  929. "produces": [
  930. "application/json"
  931. ],
  932. "tags": [
  933. "getData"
  934. ],
  935. "summary": "根据SQL执行得到数据集",
  936. "parameters": [
  937. {
  938. "type": "string",
  939. "description": "sql",
  940. "name": "sql",
  941. "in": "query",
  942. "required": true
  943. }
  944. ],
  945. "responses": {
  946. "200": {
  947. "description": "{ \"code\": 200, \"data\": {}, \"msg\": \"ok\" }",
  948. "schema": {
  949. "type": "string"
  950. }
  951. },
  952. "400": {
  953. "description": "{\"code\":400, \"data\":null,\"msg\":\"请求参数错误\"}",
  954. "schema": {
  955. "type": "string"
  956. }
  957. },
  958. "404": {
  959. "description": "{ \"code\": 404, \"data\":null,\"msg\":\"请求参数错误\"}",
  960. "schema": {
  961. "type": "string"
  962. }
  963. }
  964. }
  965. }
  966. }
  967. }
  968. }`
  969. type swaggerInfo struct {
  970. Version string
  971. Host string
  972. BasePath string
  973. Title string
  974. Description string
  975. }
  976. // SwaggerInfo holds exported Swagger Info so clients can modify it
  977. var SwaggerInfo swaggerInfo
  978. type s struct{}
  979. func (s *s) ReadDoc() string {
  980. t, err := template.New("swagger_info").Parse(doc)
  981. if err != nil {
  982. return doc
  983. }
  984. var tpl bytes.Buffer
  985. if err := t.Execute(&tpl, SwaggerInfo); err != nil {
  986. return doc
  987. }
  988. return tpl.String()
  989. }
  990. func init() {
  991. swag.Register(swag.Name, &s{})
  992. }