docs.go 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  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": "picCode",
  110. "in": "formData"
  111. },
  112. {
  113. "type": "string",
  114. "description": "手机号",
  115. "name": "phone",
  116. "in": "formData",
  117. "required": true
  118. },
  119. {
  120. "type": "integer",
  121. "description": "验证码类型 1:登录",
  122. "name": "codeType",
  123. "in": "formData",
  124. "required": true
  125. }
  126. ],
  127. "responses": {
  128. "200": {
  129. "description": "OK",
  130. "schema": {
  131. "$ref": "#/definitions/controller.ResponseBase"
  132. }
  133. }
  134. }
  135. }
  136. },
  137. "/Auth/PhoneSignIn": {
  138. "post": {
  139. "description": "手机验证码登录",
  140. "consumes": [
  141. "application/x-www-form-urlencoded"
  142. ],
  143. "produces": [
  144. "application/json"
  145. ],
  146. "tags": [
  147. "Auth"
  148. ],
  149. "summary": "手机验证码登录",
  150. "parameters": [
  151. {
  152. "type": "string",
  153. "description": "手机号",
  154. "name": "phone",
  155. "in": "formData",
  156. "required": true
  157. },
  158. {
  159. "type": "integer",
  160. "description": "验证码",
  161. "name": "smsCode",
  162. "in": "formData",
  163. "required": true
  164. }
  165. ],
  166. "responses": {
  167. "200": {
  168. "description": "OK",
  169. "schema": {
  170. "$ref": "#/definitions/controller.ResponseBase"
  171. }
  172. }
  173. }
  174. }
  175. },
  176. "/HrSensors/AddAppHeartRate": {
  177. "post": {
  178. "description": "App心率数据上报",
  179. "consumes": [
  180. "application/x-www-form-urlencoded"
  181. ],
  182. "produces": [
  183. "application/json"
  184. ],
  185. "tags": [
  186. "HrSensors"
  187. ],
  188. "summary": "App心率数据上报",
  189. "parameters": [
  190. {
  191. "type": "string",
  192. "description": "Token",
  193. "name": "token",
  194. "in": "formData",
  195. "required": true
  196. },
  197. {
  198. "type": "integer",
  199. "description": "duId",
  200. "name": "duId",
  201. "in": "formData",
  202. "required": true
  203. },
  204. {
  205. "type": "string",
  206. "description": "sn",
  207. "name": "sn",
  208. "in": "formData",
  209. "required": true
  210. },
  211. {
  212. "type": "integer",
  213. "description": "心率带id",
  214. "name": "hrId",
  215. "in": "formData",
  216. "required": true
  217. },
  218. {
  219. "type": "integer",
  220. "description": "心跳",
  221. "name": "heartRate",
  222. "in": "formData",
  223. "required": true
  224. },
  225. {
  226. "type": "integer",
  227. "description": "时间戳毫秒",
  228. "name": "rcvTime",
  229. "in": "formData",
  230. "required": true
  231. },
  232. {
  233. "type": "integer",
  234. "description": "卡路里",
  235. "name": "calories",
  236. "in": "formData",
  237. "required": true
  238. },
  239. {
  240. "type": "integer",
  241. "description": "运动卡路里",
  242. "name": "pureCalories",
  243. "in": "formData",
  244. "required": true
  245. }
  246. ],
  247. "responses": {
  248. "200": {
  249. "description": "OK",
  250. "schema": {
  251. "$ref": "#/definitions/controller.AddHRRtn"
  252. }
  253. }
  254. }
  255. }
  256. },
  257. "/HrSensors/HrSensorsUpdate": {
  258. "post": {
  259. "description": "心率带信息查询和更新",
  260. "consumes": [
  261. "application/x-www-form-urlencoded"
  262. ],
  263. "produces": [
  264. "application/json"
  265. ],
  266. "tags": [
  267. "HrSensors"
  268. ],
  269. "summary": "心率带信息查询和更新",
  270. "parameters": [
  271. {
  272. "type": "string",
  273. "description": "Token",
  274. "name": "token",
  275. "in": "formData",
  276. "required": true
  277. },
  278. {
  279. "type": "string",
  280. "description": "心率带编号",
  281. "name": "sn",
  282. "in": "formData",
  283. "required": true
  284. }
  285. ],
  286. "responses": {
  287. "200": {
  288. "description": "OK",
  289. "schema": {
  290. "$ref": "#/definitions/controller.ResponseBase"
  291. }
  292. }
  293. }
  294. }
  295. },
  296. "/User/GetDuInfoAndUserInfoByUserMd5": {
  297. "post": {
  298. "description": "查询用户当前显示单元和对应身体信息",
  299. "consumes": [
  300. "application/x-www-form-urlencoded"
  301. ],
  302. "produces": [
  303. "application/json"
  304. ],
  305. "tags": [
  306. "User"
  307. ],
  308. "summary": "查询用户是否正在上课接口",
  309. "parameters": [
  310. {
  311. "type": "string",
  312. "description": "Token",
  313. "name": "token",
  314. "in": "formData",
  315. "required": true
  316. }
  317. ],
  318. "responses": {
  319. "200": {
  320. "description": "OK",
  321. "schema": {
  322. "$ref": "#/definitions/controller.ResponseBase"
  323. }
  324. }
  325. }
  326. }
  327. },
  328. "/User/UserSelfQuery": {
  329. "post": {
  330. "description": "会员自身信息查询",
  331. "consumes": [
  332. "application/x-www-form-urlencoded"
  333. ],
  334. "produces": [
  335. "application/json"
  336. ],
  337. "tags": [
  338. "User"
  339. ],
  340. "summary": "会员自身信息查询",
  341. "parameters": [
  342. {
  343. "type": "string",
  344. "description": "Token",
  345. "name": "token",
  346. "in": "formData",
  347. "required": true
  348. }
  349. ],
  350. "responses": {
  351. "200": {
  352. "description": "OK",
  353. "schema": {
  354. "$ref": "#/definitions/controller.ResponseBase"
  355. }
  356. }
  357. }
  358. }
  359. }
  360. },
  361. "definitions": {
  362. "controller.AddHRRtn": {
  363. "type": "object",
  364. "properties": {
  365. "code": {
  366. "type": "integer"
  367. },
  368. "inClass": {
  369. "type": "integer"
  370. },
  371. "memo": {
  372. "type": "string"
  373. }
  374. }
  375. },
  376. "controller.ResponseBase": {
  377. "type": "object",
  378. "properties": {
  379. "code": {
  380. "type": "integer"
  381. },
  382. "memo": {
  383. "type": "string"
  384. }
  385. }
  386. },
  387. "controller.ResponseVerifyPic": {
  388. "type": "object",
  389. "properties": {
  390. "id": {
  391. "type": "string"
  392. },
  393. "pic": {
  394. "type": "string"
  395. }
  396. }
  397. }
  398. },
  399. "securityDefinitions": {
  400. "ApiKeyAuth": {
  401. "type": "apiKey",
  402. "name": "Authorization",
  403. "in": "header"
  404. },
  405. "BasicAuth": {
  406. "type": "basic"
  407. },
  408. "OAuth2AccessCode": {
  409. "type": "oauth2",
  410. "flow": "accessCode",
  411. "authorizationUrl": "https://example.com/oauth/authorize",
  412. "tokenUrl": "https://example.com/oauth/token",
  413. "scopes": {
  414. "admin": " Grants read and write access to administrative information"
  415. }
  416. },
  417. "OAuth2Application": {
  418. "type": "oauth2",
  419. "flow": "application",
  420. "tokenUrl": "https://example.com/oauth/token",
  421. "scopes": {
  422. "admin": " Grants read and write access to administrative information",
  423. "write": " Grants write access"
  424. }
  425. },
  426. "OAuth2Implicit": {
  427. "type": "oauth2",
  428. "flow": "implicit",
  429. "authorizationUrl": "https://example.com/oauth/authorize",
  430. "scopes": {
  431. "admin": " Grants read and write access to administrative information",
  432. "write": " Grants write access"
  433. }
  434. },
  435. "OAuth2Password": {
  436. "type": "oauth2",
  437. "flow": "password",
  438. "tokenUrl": "https://example.com/oauth/token",
  439. "scopes": {
  440. "admin": " Grants read and write access to administrative information",
  441. "read": " Grants read access",
  442. "write": " Grants write access"
  443. }
  444. }
  445. }
  446. }`
  447. type swaggerInfo struct {
  448. Version string
  449. Host string
  450. BasePath string
  451. Schemes []string
  452. Title string
  453. Description string
  454. }
  455. // SwaggerInfo holds exported Swagger Info so clients can modify it
  456. var SwaggerInfo = swaggerInfo{
  457. Version: "1.0",
  458. Host: "",
  459. BasePath: "/v1",
  460. Schemes: []string{},
  461. Title: "Video Course框架",
  462. Description: "Video Course框架 API 文档",
  463. }
  464. type s struct{}
  465. func (s *s) ReadDoc() string {
  466. sInfo := SwaggerInfo
  467. sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1)
  468. t, err := template.New("swagger_info").Funcs(template.FuncMap{
  469. "marshal": func(v interface{}) string {
  470. a, _ := json.Marshal(v)
  471. return string(a)
  472. },
  473. }).Parse(doc)
  474. if err != nil {
  475. return doc
  476. }
  477. var tpl bytes.Buffer
  478. if err := t.Execute(&tpl, sInfo); err != nil {
  479. return doc
  480. }
  481. return tpl.String()
  482. }
  483. func init() {
  484. swag.Register(swag.Name, &s{})
  485. }