docs.go 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048
  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. "termsOfService": "http://swagger.io/terms/",
  18. "contact": {
  19. "name": "API Support",
  20. "url": "http://www.swagger.io/support",
  21. "email": "support@swagger.io"
  22. },
  23. "license": {
  24. "name": "Apache 2.0",
  25. "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
  26. },
  27. "version": "{{.Version}}"
  28. },
  29. "host": "{{.Host}}",
  30. "basePath": "{{.BasePath}}",
  31. "paths": {
  32. "/Auth/GenVerifyPic": {
  33. "post": {
  34. "description": "获取验证图片和验证id",
  35. "consumes": [
  36. "application/x-www-form-urlencoded"
  37. ],
  38. "produces": [
  39. "application/json"
  40. ],
  41. "tags": [
  42. "Auth"
  43. ],
  44. "summary": "获取验证图片",
  45. "parameters": [
  46. {
  47. "type": "string",
  48. "description": "高",
  49. "name": "height",
  50. "in": "formData",
  51. "required": true
  52. },
  53. {
  54. "type": "string",
  55. "description": "宽",
  56. "name": "width",
  57. "in": "formData",
  58. "required": true
  59. },
  60. {
  61. "type": "string",
  62. "description": "噪点数量",
  63. "name": "noiseCount",
  64. "in": "formData",
  65. "required": true
  66. },
  67. {
  68. "type": "string",
  69. "description": "验证码字数",
  70. "name": "length",
  71. "in": "formData",
  72. "required": true
  73. },
  74. {
  75. "type": "string",
  76. "description": "验证码取值范围 比如 1234567890 或者 abcdef等",
  77. "name": "source",
  78. "in": "formData",
  79. "required": true
  80. }
  81. ],
  82. "responses": {
  83. "200": {
  84. "description": "OK",
  85. "schema": {
  86. "$ref": "#/definitions/controller.ResponseVerifyPic"
  87. }
  88. }
  89. }
  90. }
  91. },
  92. "/Auth/GetPhoneVFCode": {
  93. "post": {
  94. "description": "手机获取验证码",
  95. "consumes": [
  96. "application/x-www-form-urlencoded"
  97. ],
  98. "produces": [
  99. "application/json"
  100. ],
  101. "tags": [
  102. "Auth"
  103. ],
  104. "summary": "手机获取验证码",
  105. "parameters": [
  106. {
  107. "type": "string",
  108. "description": "手机号",
  109. "name": "phone",
  110. "in": "formData",
  111. "required": true
  112. },
  113. {
  114. "type": "integer",
  115. "description": "验证码类型 1:登录",
  116. "name": "codeType",
  117. "in": "formData",
  118. "required": true
  119. },
  120. {
  121. "type": "string",
  122. "description": "图形验证码id",
  123. "name": "picId",
  124. "in": "formData",
  125. "required": true
  126. },
  127. {
  128. "type": "string",
  129. "description": "图形验证码",
  130. "name": "picCode",
  131. "in": "formData",
  132. "required": true
  133. }
  134. ],
  135. "responses": {
  136. "200": {
  137. "description": "OK",
  138. "schema": {
  139. "$ref": "#/definitions/controller.ResponseBase"
  140. }
  141. }
  142. }
  143. }
  144. },
  145. "/Auth/PhoneSignIn": {
  146. "post": {
  147. "description": "手机验证码登录",
  148. "consumes": [
  149. "application/x-www-form-urlencoded"
  150. ],
  151. "produces": [
  152. "application/json"
  153. ],
  154. "tags": [
  155. "Auth"
  156. ],
  157. "summary": "手机验证码登录",
  158. "parameters": [
  159. {
  160. "type": "string",
  161. "description": "手机号",
  162. "name": "phone",
  163. "in": "formData",
  164. "required": true
  165. },
  166. {
  167. "type": "integer",
  168. "description": "验证码",
  169. "name": "smsCode",
  170. "in": "formData",
  171. "required": true
  172. }
  173. ],
  174. "responses": {
  175. "200": {
  176. "description": "OK",
  177. "schema": {
  178. "$ref": "#/definitions/controller.ResponseBase"
  179. }
  180. }
  181. }
  182. }
  183. },
  184. "/Auth/SignUp": {
  185. "post": {
  186. "description": "用户添加",
  187. "consumes": [
  188. "application/x-www-form-urlencoded"
  189. ],
  190. "produces": [
  191. "application/json"
  192. ],
  193. "tags": [
  194. "Auth"
  195. ],
  196. "summary": "用户添加",
  197. "parameters": [
  198. {
  199. "type": "string",
  200. "description": "用户名",
  201. "name": "userCode",
  202. "in": "formData",
  203. "required": true
  204. },
  205. {
  206. "type": "string",
  207. "description": "密码",
  208. "name": "password",
  209. "in": "formData",
  210. "required": true
  211. },
  212. {
  213. "type": "string",
  214. "description": "邮箱",
  215. "name": "email",
  216. "in": "formData"
  217. },
  218. {
  219. "type": "string",
  220. "description": "手机号",
  221. "name": "phone",
  222. "in": "formData"
  223. },
  224. {
  225. "type": "string",
  226. "description": "姓名",
  227. "name": "name",
  228. "in": "formData"
  229. }
  230. ],
  231. "responses": {
  232. "200": {
  233. "description": "OK",
  234. "schema": {
  235. "$ref": "#/definitions/controller.ResponseBase"
  236. }
  237. }
  238. }
  239. }
  240. },
  241. "/HrSensors/AddHrSensors": {
  242. "post": {
  243. "description": "添加商家公共心率设备",
  244. "consumes": [
  245. "application/x-www-form-urlencoded"
  246. ],
  247. "produces": [
  248. "application/json"
  249. ],
  250. "tags": [
  251. "HrSensors"
  252. ],
  253. "summary": "添加商家公共心率设备",
  254. "parameters": [
  255. {
  256. "type": "string",
  257. "description": "Token",
  258. "name": "token",
  259. "in": "formData",
  260. "required": true
  261. },
  262. {
  263. "type": "integer",
  264. "description": "商家ID",
  265. "name": "shopId",
  266. "in": "formData",
  267. "required": true
  268. },
  269. {
  270. "type": "integer",
  271. "description": "心率带Sn",
  272. "name": "sn",
  273. "in": "formData",
  274. "required": true
  275. },
  276. {
  277. "type": "string",
  278. "description": "场馆内编号 01 02",
  279. "name": "venueNo",
  280. "in": "formData"
  281. }
  282. ],
  283. "responses": {
  284. "200": {
  285. "description": "OK",
  286. "schema": {
  287. "$ref": "#/definitions/controller.ResponseBase"
  288. }
  289. }
  290. }
  291. }
  292. },
  293. "/HrSensors/AddPvtHrSensors": {
  294. "post": {
  295. "description": "添加会员私有心率设备",
  296. "consumes": [
  297. "application/x-www-form-urlencoded"
  298. ],
  299. "produces": [
  300. "application/json"
  301. ],
  302. "tags": [
  303. "HrSensors"
  304. ],
  305. "summary": "添加会员私有心率设备",
  306. "parameters": [
  307. {
  308. "type": "string",
  309. "description": "Token",
  310. "name": "token",
  311. "in": "formData",
  312. "required": true
  313. },
  314. {
  315. "type": "integer",
  316. "description": "商家ID",
  317. "name": "shopId",
  318. "in": "formData",
  319. "required": true
  320. },
  321. {
  322. "type": "integer",
  323. "description": "心率带Sn",
  324. "name": "sn",
  325. "in": "formData",
  326. "required": true
  327. },
  328. {
  329. "type": "integer",
  330. "description": "用户ID",
  331. "name": "userId",
  332. "in": "formData",
  333. "required": true
  334. }
  335. ],
  336. "responses": {
  337. "200": {
  338. "description": "OK",
  339. "schema": {
  340. "$ref": "#/definitions/controller.ResponseBase"
  341. }
  342. }
  343. }
  344. }
  345. },
  346. "/HrSensors/BindHrSensorsToUser": {
  347. "post": {
  348. "description": "心率带绑定用户",
  349. "consumes": [
  350. "application/x-www-form-urlencoded"
  351. ],
  352. "produces": [
  353. "application/json"
  354. ],
  355. "tags": [
  356. "HrSensors"
  357. ],
  358. "summary": "心率带绑定用户",
  359. "parameters": [
  360. {
  361. "type": "string",
  362. "description": "Token",
  363. "name": "token",
  364. "in": "formData",
  365. "required": true
  366. },
  367. {
  368. "type": "string",
  369. "description": "心率带Sn",
  370. "name": "sn",
  371. "in": "formData",
  372. "required": true
  373. },
  374. {
  375. "type": "integer",
  376. "description": "课堂记录Id,必传字段",
  377. "name": "cfId",
  378. "in": "formData",
  379. "required": true
  380. },
  381. {
  382. "type": "integer",
  383. "description": "用户Id",
  384. "name": "userId",
  385. "in": "formData",
  386. "required": true
  387. },
  388. {
  389. "type": "integer",
  390. "description": "商家ID",
  391. "name": "shopId",
  392. "in": "formData",
  393. "required": true
  394. },
  395. {
  396. "type": "integer",
  397. "description": "心率带ID",
  398. "name": "hrId",
  399. "in": "formData",
  400. "required": true
  401. }
  402. ],
  403. "responses": {
  404. "200": {
  405. "description": "OK",
  406. "schema": {
  407. "$ref": "#/definitions/controller.ResponseBase"
  408. }
  409. }
  410. }
  411. }
  412. },
  413. "/HrSensors/EditHrSensors": {
  414. "post": {
  415. "description": "修改商家心率设备信息",
  416. "consumes": [
  417. "application/x-www-form-urlencoded"
  418. ],
  419. "produces": [
  420. "application/json"
  421. ],
  422. "tags": [
  423. "HrSensors"
  424. ],
  425. "summary": "修改商家心率设备信息",
  426. "parameters": [
  427. {
  428. "type": "string",
  429. "description": "Token",
  430. "name": "token",
  431. "in": "formData",
  432. "required": true
  433. },
  434. {
  435. "type": "integer",
  436. "description": "心率带ID",
  437. "name": "hrId",
  438. "in": "formData",
  439. "required": true
  440. },
  441. {
  442. "type": "string",
  443. "description": "心率带Sn",
  444. "name": "sn",
  445. "in": "formData",
  446. "required": true
  447. },
  448. {
  449. "type": "string",
  450. "description": "商家ID",
  451. "name": "shopId",
  452. "in": "formData",
  453. "required": true
  454. },
  455. {
  456. "type": "string",
  457. "description": "场馆内编号 01 02",
  458. "name": "venueNo",
  459. "in": "formData"
  460. }
  461. ],
  462. "responses": {
  463. "200": {
  464. "description": "OK",
  465. "schema": {
  466. "$ref": "#/definitions/controller.ResponseBase"
  467. }
  468. }
  469. }
  470. }
  471. },
  472. "/HrSensors/GetHrSensorsPowerPercent": {
  473. "post": {
  474. "description": "获取心率带电量",
  475. "consumes": [
  476. "application/x-www-form-urlencoded"
  477. ],
  478. "produces": [
  479. "application/json"
  480. ],
  481. "tags": [
  482. "HrSensors"
  483. ],
  484. "summary": "获取心率带电量",
  485. "parameters": [
  486. {
  487. "type": "string",
  488. "description": "Token",
  489. "name": "token",
  490. "in": "formData",
  491. "required": true
  492. },
  493. {
  494. "type": "integer",
  495. "description": "商家ID",
  496. "name": "shopId",
  497. "in": "formData",
  498. "required": true
  499. },
  500. {
  501. "type": "integer",
  502. "description": "心率带Id",
  503. "name": "hrId",
  504. "in": "formData"
  505. }
  506. ],
  507. "responses": {
  508. "200": {
  509. "description": "OK",
  510. "schema": {
  511. "$ref": "#/definitions/controller.ResponseBase"
  512. }
  513. }
  514. }
  515. }
  516. },
  517. "/HrSensors/HrSensorsBindHistory": {
  518. "post": {
  519. "description": "查询心率带绑定历史记录",
  520. "consumes": [
  521. "application/x-www-form-urlencoded"
  522. ],
  523. "produces": [
  524. "application/json"
  525. ],
  526. "tags": [
  527. "HrSensors"
  528. ],
  529. "summary": "查询心率带绑定历史记录",
  530. "parameters": [
  531. {
  532. "type": "string",
  533. "description": "Token",
  534. "name": "token",
  535. "in": "formData",
  536. "required": true
  537. },
  538. {
  539. "type": "integer",
  540. "description": "心率带ID",
  541. "name": "hrId",
  542. "in": "formData"
  543. },
  544. {
  545. "type": "string",
  546. "description": "开始时间 2020-10-10 00:00:01",
  547. "name": "bt",
  548. "in": "formData",
  549. "required": true
  550. },
  551. {
  552. "type": "string",
  553. "description": "结束时间 2020-10-10 23:59:59",
  554. "name": "et",
  555. "in": "formData",
  556. "required": true
  557. }
  558. ],
  559. "responses": {
  560. "200": {
  561. "description": "OK",
  562. "schema": {
  563. "$ref": "#/definitions/controller.ResponseBase"
  564. }
  565. }
  566. }
  567. }
  568. },
  569. "/HrSensors/HrSensorsStatusEdit": {
  570. "post": {
  571. "description": "修改商家心率设备状态",
  572. "consumes": [
  573. "application/x-www-form-urlencoded"
  574. ],
  575. "produces": [
  576. "application/json"
  577. ],
  578. "tags": [
  579. "HrSensors"
  580. ],
  581. "summary": "修改商家心率设备状态",
  582. "parameters": [
  583. {
  584. "type": "string",
  585. "description": "Token",
  586. "name": "token",
  587. "in": "formData",
  588. "required": true
  589. },
  590. {
  591. "type": "integer",
  592. "description": "心率带ID",
  593. "name": "hrId",
  594. "in": "formData",
  595. "required": true
  596. },
  597. {
  598. "type": "integer",
  599. "description": "状态, 1:启用,8:暂停,9:删除",
  600. "name": "status",
  601. "in": "formData",
  602. "required": true
  603. }
  604. ],
  605. "responses": {
  606. "200": {
  607. "description": "OK",
  608. "schema": {
  609. "$ref": "#/definitions/controller.ResponseBase"
  610. }
  611. }
  612. }
  613. }
  614. },
  615. "/HrSensors/QueryHrSensors": {
  616. "post": {
  617. "description": "查询商家公共心率设备",
  618. "consumes": [
  619. "application/x-www-form-urlencoded"
  620. ],
  621. "produces": [
  622. "application/json"
  623. ],
  624. "tags": [
  625. "HrSensors"
  626. ],
  627. "summary": "查询商家公共心率设备",
  628. "parameters": [
  629. {
  630. "type": "string",
  631. "description": "Token",
  632. "name": "token",
  633. "in": "formData",
  634. "required": true
  635. },
  636. {
  637. "type": "integer",
  638. "description": "商家ID",
  639. "name": "shopId",
  640. "in": "formData",
  641. "required": true
  642. },
  643. {
  644. "type": "integer",
  645. "description": "设备状态",
  646. "name": "status",
  647. "in": "formData"
  648. },
  649. {
  650. "type": "string",
  651. "description": "模糊查询sn与场内编号",
  652. "name": "str",
  653. "in": "formData"
  654. }
  655. ],
  656. "responses": {
  657. "200": {
  658. "description": "OK",
  659. "schema": {
  660. "$ref": "#/definitions/controller.ResponseBase"
  661. }
  662. }
  663. }
  664. }
  665. },
  666. "/HrSensors/QueryPvtHrSensors": {
  667. "post": {
  668. "description": "查询商家会员私有心率设备",
  669. "consumes": [
  670. "application/x-www-form-urlencoded"
  671. ],
  672. "produces": [
  673. "application/json"
  674. ],
  675. "tags": [
  676. "HrSensors"
  677. ],
  678. "summary": "查询商家会员私有心率设备",
  679. "parameters": [
  680. {
  681. "type": "string",
  682. "description": "Token",
  683. "name": "token",
  684. "in": "formData",
  685. "required": true
  686. },
  687. {
  688. "type": "integer",
  689. "description": "商家ID",
  690. "name": "shopId",
  691. "in": "formData",
  692. "required": true
  693. },
  694. {
  695. "type": "integer",
  696. "description": "设备状态",
  697. "name": "status",
  698. "in": "formData"
  699. },
  700. {
  701. "type": "string",
  702. "description": "用户姓名",
  703. "name": "userName",
  704. "in": "formData"
  705. },
  706. {
  707. "type": "string",
  708. "description": "模糊查询sn与场内编号",
  709. "name": "str",
  710. "in": "formData"
  711. }
  712. ],
  713. "responses": {
  714. "200": {
  715. "description": "OK",
  716. "schema": {
  717. "$ref": "#/definitions/controller.ResponseBase"
  718. }
  719. }
  720. }
  721. }
  722. },
  723. "/HrSensors/SelectHrSensors": {
  724. "post": {
  725. "description": "查询未绑定的心率带--下拉框用",
  726. "consumes": [
  727. "application/x-www-form-urlencoded"
  728. ],
  729. "produces": [
  730. "application/json"
  731. ],
  732. "tags": [
  733. "HrSensors"
  734. ],
  735. "summary": "查询未绑定的心率带--下拉框用",
  736. "parameters": [
  737. {
  738. "type": "string",
  739. "description": "Token",
  740. "name": "token",
  741. "in": "formData",
  742. "required": true
  743. },
  744. {
  745. "type": "integer",
  746. "description": "用户ID",
  747. "name": "userId",
  748. "in": "formData"
  749. }
  750. ],
  751. "responses": {
  752. "200": {
  753. "description": "OK",
  754. "schema": {
  755. "$ref": "#/definitions/controller.ResponseBase"
  756. }
  757. }
  758. }
  759. }
  760. },
  761. "/HrSensors/UnBindHrSensorsToUser": {
  762. "post": {
  763. "description": "心率带解绑用户",
  764. "consumes": [
  765. "application/x-www-form-urlencoded"
  766. ],
  767. "produces": [
  768. "application/json"
  769. ],
  770. "tags": [
  771. "HrSensors"
  772. ],
  773. "summary": "心率带解绑用户",
  774. "parameters": [
  775. {
  776. "type": "string",
  777. "description": "Token",
  778. "name": "token",
  779. "in": "formData",
  780. "required": true
  781. },
  782. {
  783. "type": "integer",
  784. "description": "课堂记录Id,必传字段",
  785. "name": "cfId",
  786. "in": "formData",
  787. "required": true
  788. },
  789. {
  790. "type": "integer",
  791. "description": "绑定ID",
  792. "name": "bindId",
  793. "in": "formData",
  794. "required": true
  795. },
  796. {
  797. "type": "integer",
  798. "description": "用户ID",
  799. "name": "userId",
  800. "in": "formData",
  801. "required": true
  802. },
  803. {
  804. "type": "string",
  805. "description": "心率带Sn",
  806. "name": "sn",
  807. "in": "formData",
  808. "required": true
  809. }
  810. ],
  811. "responses": {
  812. "200": {
  813. "description": "OK",
  814. "schema": {
  815. "$ref": "#/definitions/controller.ResponseBase"
  816. }
  817. }
  818. }
  819. }
  820. },
  821. "/Test/UserAdd": {
  822. "post": {
  823. "description": "会员用户添加",
  824. "consumes": [
  825. "application/x-www-form-urlencoded"
  826. ],
  827. "produces": [
  828. "application/json"
  829. ],
  830. "tags": [
  831. "Test"
  832. ],
  833. "summary": "会员用户添加",
  834. "parameters": [
  835. {
  836. "type": "string",
  837. "description": "姓名",
  838. "name": "name",
  839. "in": "formData",
  840. "required": true
  841. }
  842. ],
  843. "responses": {
  844. "200": {
  845. "description": "OK",
  846. "schema": {
  847. "$ref": "#/definitions/controller.ResponseBase"
  848. }
  849. }
  850. }
  851. }
  852. },
  853. "/Test/UserListQuery": {
  854. "post": {
  855. "description": "会员用户查询",
  856. "consumes": [
  857. "application/x-www-form-urlencoded"
  858. ],
  859. "produces": [
  860. "application/json"
  861. ],
  862. "tags": [
  863. "Test"
  864. ],
  865. "summary": "会员用户查询",
  866. "responses": {
  867. "200": {
  868. "description": "OK",
  869. "schema": {
  870. "$ref": "#/definitions/controller.UserList"
  871. }
  872. }
  873. }
  874. }
  875. },
  876. "/User/UserInfoQuery": {
  877. "post": {
  878. "description": "会员信息查询",
  879. "consumes": [
  880. "application/x-www-form-urlencoded"
  881. ],
  882. "produces": [
  883. "application/json"
  884. ],
  885. "tags": [
  886. "User"
  887. ],
  888. "summary": "会员信息查询",
  889. "parameters": [
  890. {
  891. "type": "string",
  892. "description": "Token",
  893. "name": "token",
  894. "in": "formData",
  895. "required": true
  896. }
  897. ],
  898. "responses": {
  899. "200": {
  900. "description": "OK",
  901. "schema": {
  902. "$ref": "#/definitions/controller.ResponseBase"
  903. }
  904. }
  905. }
  906. }
  907. }
  908. },
  909. "definitions": {
  910. "controller.ResponseBase": {
  911. "type": "object",
  912. "properties": {
  913. "code": {
  914. "type": "integer"
  915. },
  916. "memo": {
  917. "type": "string"
  918. }
  919. }
  920. },
  921. "controller.ResponseVerifyPic": {
  922. "type": "object",
  923. "properties": {
  924. "id": {
  925. "type": "string"
  926. },
  927. "pic": {
  928. "type": "string"
  929. }
  930. }
  931. },
  932. "controller.UserList": {
  933. "type": "object",
  934. "properties": {
  935. "code": {
  936. "type": "integer"
  937. },
  938. "memo": {
  939. "type": "string"
  940. },
  941. "rs": {
  942. "type": "array",
  943. "items": {
  944. "type": "object"
  945. }
  946. }
  947. }
  948. }
  949. },
  950. "securityDefinitions": {
  951. "ApiKeyAuth": {
  952. "type": "apiKey",
  953. "name": "Authorization",
  954. "in": "header"
  955. },
  956. "BasicAuth": {
  957. "type": "basic"
  958. },
  959. "OAuth2AccessCode": {
  960. "type": "oauth2",
  961. "flow": "accessCode",
  962. "authorizationUrl": "https://example.com/oauth/authorize",
  963. "tokenUrl": "https://example.com/oauth/token",
  964. "scopes": {
  965. "admin": " Grants read and write access to administrative information"
  966. }
  967. },
  968. "OAuth2Application": {
  969. "type": "oauth2",
  970. "flow": "application",
  971. "tokenUrl": "https://example.com/oauth/token",
  972. "scopes": {
  973. "admin": " Grants read and write access to administrative information",
  974. "write": " Grants write access"
  975. }
  976. },
  977. "OAuth2Implicit": {
  978. "type": "oauth2",
  979. "flow": "implicit",
  980. "authorizationUrl": "https://example.com/oauth/authorize",
  981. "scopes": {
  982. "admin": " Grants read and write access to administrative information",
  983. "write": " Grants write access"
  984. }
  985. },
  986. "OAuth2Password": {
  987. "type": "oauth2",
  988. "flow": "password",
  989. "tokenUrl": "https://example.com/oauth/token",
  990. "scopes": {
  991. "admin": " Grants read and write access to administrative information",
  992. "read": " Grants read access",
  993. "write": " Grants write access"
  994. }
  995. }
  996. }
  997. }`
  998. type swaggerInfo struct {
  999. Version string
  1000. Host string
  1001. BasePath string
  1002. Schemes []string
  1003. Title string
  1004. Description string
  1005. }
  1006. // SwaggerInfo holds exported Swagger Info so clients can modify it
  1007. var SwaggerInfo = swaggerInfo{
  1008. Version: "1.0",
  1009. Host: "",
  1010. BasePath: "/v1",
  1011. Schemes: []string{},
  1012. Title: "Video Course框架",
  1013. Description: "Video Course框架 API 文档",
  1014. }
  1015. type s struct{}
  1016. func (s *s) ReadDoc() string {
  1017. sInfo := SwaggerInfo
  1018. sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1)
  1019. t, err := template.New("swagger_info").Funcs(template.FuncMap{
  1020. "marshal": func(v interface{}) string {
  1021. a, _ := json.Marshal(v)
  1022. return string(a)
  1023. },
  1024. }).Parse(doc)
  1025. if err != nil {
  1026. return doc
  1027. }
  1028. var tpl bytes.Buffer
  1029. if err := t.Execute(&tpl, sInfo); err != nil {
  1030. return doc
  1031. }
  1032. return tpl.String()
  1033. }
  1034. func init() {
  1035. swag.Register(swag.Name, &s{})
  1036. }