docs.go 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  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. "/Test/UserAdd": {
  185. "post": {
  186. "description": "会员用户添加",
  187. "consumes": [
  188. "application/x-www-form-urlencoded"
  189. ],
  190. "produces": [
  191. "application/json"
  192. ],
  193. "tags": [
  194. "Test"
  195. ],
  196. "summary": "会员用户添加",
  197. "parameters": [
  198. {
  199. "type": "string",
  200. "description": "姓名",
  201. "name": "name",
  202. "in": "formData",
  203. "required": true
  204. }
  205. ],
  206. "responses": {
  207. "200": {
  208. "description": "OK",
  209. "schema": {
  210. "$ref": "#/definitions/controller.ResponseBase"
  211. }
  212. }
  213. }
  214. }
  215. },
  216. "/Test/UserListQuery": {
  217. "post": {
  218. "description": "会员用户查询",
  219. "consumes": [
  220. "application/x-www-form-urlencoded"
  221. ],
  222. "produces": [
  223. "application/json"
  224. ],
  225. "tags": [
  226. "Test"
  227. ],
  228. "summary": "会员用户查询",
  229. "responses": {
  230. "200": {
  231. "description": "OK",
  232. "schema": {
  233. "$ref": "#/definitions/controller.UserList"
  234. }
  235. }
  236. }
  237. }
  238. },
  239. "/User/UserSelfQuery": {
  240. "post": {
  241. "description": "会员信息查询",
  242. "consumes": [
  243. "application/x-www-form-urlencoded"
  244. ],
  245. "produces": [
  246. "application/json"
  247. ],
  248. "tags": [
  249. "User"
  250. ],
  251. "summary": "会员信息查询",
  252. "parameters": [
  253. {
  254. "type": "string",
  255. "description": "Token",
  256. "name": "token",
  257. "in": "formData",
  258. "required": true
  259. }
  260. ],
  261. "responses": {
  262. "200": {
  263. "description": "OK",
  264. "schema": {
  265. "$ref": "#/definitions/controller.ResponseBase"
  266. }
  267. }
  268. }
  269. }
  270. }
  271. },
  272. "definitions": {
  273. "controller.ResponseBase": {
  274. "type": "object",
  275. "properties": {
  276. "code": {
  277. "type": "integer"
  278. },
  279. "memo": {
  280. "type": "string"
  281. }
  282. }
  283. },
  284. "controller.ResponseVerifyPic": {
  285. "type": "object",
  286. "properties": {
  287. "id": {
  288. "type": "string"
  289. },
  290. "pic": {
  291. "type": "string"
  292. }
  293. }
  294. },
  295. "controller.UserList": {
  296. "type": "object",
  297. "properties": {
  298. "code": {
  299. "type": "integer"
  300. },
  301. "memo": {
  302. "type": "string"
  303. },
  304. "rs": {
  305. "type": "array",
  306. "items": {
  307. "type": "object"
  308. }
  309. }
  310. }
  311. }
  312. },
  313. "securityDefinitions": {
  314. "ApiKeyAuth": {
  315. "type": "apiKey",
  316. "name": "Authorization",
  317. "in": "header"
  318. },
  319. "BasicAuth": {
  320. "type": "basic"
  321. },
  322. "OAuth2AccessCode": {
  323. "type": "oauth2",
  324. "flow": "accessCode",
  325. "authorizationUrl": "https://example.com/oauth/authorize",
  326. "tokenUrl": "https://example.com/oauth/token",
  327. "scopes": {
  328. "admin": " Grants read and write access to administrative information"
  329. }
  330. },
  331. "OAuth2Application": {
  332. "type": "oauth2",
  333. "flow": "application",
  334. "tokenUrl": "https://example.com/oauth/token",
  335. "scopes": {
  336. "admin": " Grants read and write access to administrative information",
  337. "write": " Grants write access"
  338. }
  339. },
  340. "OAuth2Implicit": {
  341. "type": "oauth2",
  342. "flow": "implicit",
  343. "authorizationUrl": "https://example.com/oauth/authorize",
  344. "scopes": {
  345. "admin": " Grants read and write access to administrative information",
  346. "write": " Grants write access"
  347. }
  348. },
  349. "OAuth2Password": {
  350. "type": "oauth2",
  351. "flow": "password",
  352. "tokenUrl": "https://example.com/oauth/token",
  353. "scopes": {
  354. "admin": " Grants read and write access to administrative information",
  355. "read": " Grants read access",
  356. "write": " Grants write access"
  357. }
  358. }
  359. }
  360. }`
  361. type swaggerInfo struct {
  362. Version string
  363. Host string
  364. BasePath string
  365. Schemes []string
  366. Title string
  367. Description string
  368. }
  369. // SwaggerInfo holds exported Swagger Info so clients can modify it
  370. var SwaggerInfo = swaggerInfo{
  371. Version: "1.0",
  372. Host: "",
  373. BasePath: "/v1",
  374. Schemes: []string{},
  375. Title: "Video Course框架",
  376. Description: "Video Course框架 API 文档",
  377. }
  378. type s struct{}
  379. func (s *s) ReadDoc() string {
  380. sInfo := SwaggerInfo
  381. sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1)
  382. t, err := template.New("swagger_info").Funcs(template.FuncMap{
  383. "marshal": func(v interface{}) string {
  384. a, _ := json.Marshal(v)
  385. return string(a)
  386. },
  387. }).Parse(doc)
  388. if err != nil {
  389. return doc
  390. }
  391. var tpl bytes.Buffer
  392. if err := t.Execute(&tpl, sInfo); err != nil {
  393. return doc
  394. }
  395. return tpl.String()
  396. }
  397. func init() {
  398. swag.Register(swag.Name, &s{})
  399. }