You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

235 lines
6.5 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. // GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
  2. // This file was generated by swaggo/swag at
  3. // 2019-09-05 23:15:39.7963441 +0800 CST m=+0.062832501
  4. package docs
  5. import (
  6. "bytes"
  7. "encoding/json"
  8. "strings"
  9. "github.com/alecthomas/template"
  10. "github.com/swaggo/swag"
  11. )
  12. var doc = `{
  13. "schemes": {{ marshal .Schemes }},
  14. "swagger": "2.0",
  15. "info": {
  16. "description": "{{.Description}}",
  17. "title": "{{.Title}}",
  18. "contact": {},
  19. "license": {},
  20. "version": "{{.Version}}"
  21. },
  22. "host": "{{.Host}}",
  23. "basePath": "{{.BasePath}}",
  24. "paths": {
  25. "/user/changePassWord": {
  26. "post": {
  27. "produces": [
  28. "application/json"
  29. ],
  30. "tags": [
  31. "User"
  32. ],
  33. "summary": "用户修改密码",
  34. "parameters": [
  35. {
  36. "description": "用户修改密码",
  37. "name": "data",
  38. "in": "body",
  39. "required": true,
  40. "schema": {
  41. "type": "object",
  42. "$ref": "#/definitions/api.ChangePassWordStutrc"
  43. }
  44. }
  45. ],
  46. "responses": {
  47. "200": {
  48. "description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}",
  49. "schema": {
  50. "type": "string"
  51. }
  52. }
  53. }
  54. }
  55. },
  56. "/user/login": {
  57. "post": {
  58. "produces": [
  59. "application/json"
  60. ],
  61. "tags": [
  62. "User"
  63. ],
  64. "summary": "用户登录",
  65. "parameters": [
  66. {
  67. "description": "用户登录接口",
  68. "name": "data",
  69. "in": "body",
  70. "required": true,
  71. "schema": {
  72. "type": "object",
  73. "$ref": "#/definitions/api.RegistAndLoginStuct"
  74. }
  75. }
  76. ],
  77. "responses": {
  78. "200": {
  79. "description": "{\"success\":true,\"data\":{},\"msg\":\"登陆成功\"}",
  80. "schema": {
  81. "type": "string"
  82. }
  83. }
  84. }
  85. }
  86. },
  87. "/user/regist": {
  88. "post": {
  89. "produces": [
  90. "application/json"
  91. ],
  92. "tags": [
  93. "User"
  94. ],
  95. "summary": "用户注册账号",
  96. "parameters": [
  97. {
  98. "description": "用户注册接口",
  99. "name": "data",
  100. "in": "body",
  101. "required": true,
  102. "schema": {
  103. "type": "object",
  104. "$ref": "#/definitions/api.RegistAndLoginStuct"
  105. }
  106. }
  107. ],
  108. "responses": {
  109. "200": {
  110. "description": "{\"success\":true,\"data\":{},\"msg\":\"注册成功\"}",
  111. "schema": {
  112. "type": "string"
  113. }
  114. }
  115. }
  116. }
  117. },
  118. "/user/uploadHeaderImg": {
  119. "post": {
  120. "consumes": [
  121. "multipart/form-data"
  122. ],
  123. "produces": [
  124. "application/json"
  125. ],
  126. "tags": [
  127. "User"
  128. ],
  129. "summary": "用户上传头像",
  130. "parameters": [
  131. {
  132. "type": "file",
  133. "description": "用户上传头像",
  134. "name": "headerImg",
  135. "in": "formData",
  136. "required": true
  137. },
  138. {
  139. "type": "string",
  140. "description": "用户上传头像",
  141. "name": "userName",
  142. "in": "formData",
  143. "required": true
  144. }
  145. ],
  146. "responses": {
  147. "200": {
  148. "description": "{\"success\":true,\"data\":{},\"msg\":\"上传成功\"}",
  149. "schema": {
  150. "type": "string"
  151. }
  152. }
  153. }
  154. }
  155. }
  156. },
  157. "definitions": {
  158. "api.ChangePassWordStutrc": {
  159. "type": "object",
  160. "properties": {
  161. "newPassWord": {
  162. "type": "string"
  163. },
  164. "passWord": {
  165. "type": "string"
  166. },
  167. "userName": {
  168. "type": "string"
  169. }
  170. }
  171. },
  172. "api.RegistAndLoginStuct": {
  173. "type": "object",
  174. "properties": {
  175. "passWord": {
  176. "type": "string"
  177. },
  178. "userName": {
  179. "type": "string"
  180. }
  181. }
  182. }
  183. }
  184. }`
  185. type swaggerInfo struct {
  186. Version string
  187. Host string
  188. BasePath string
  189. Schemes []string
  190. Title string
  191. Description string
  192. }
  193. // SwaggerInfo holds exported Swagger Info so clients can modify it
  194. var SwaggerInfo = swaggerInfo{
  195. Version: "",
  196. Host: "",
  197. BasePath: "",
  198. Schemes: []string{},
  199. Title: "",
  200. Description: "",
  201. }
  202. type s struct{}
  203. func (s *s) ReadDoc() string {
  204. sInfo := SwaggerInfo
  205. sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1)
  206. t, err := template.New("swagger_info").Funcs(template.FuncMap{
  207. "marshal": func(v interface{}) string {
  208. a, _ := json.Marshal(v)
  209. return string(a)
  210. },
  211. }).Parse(doc)
  212. if err != nil {
  213. return doc
  214. }
  215. var tpl bytes.Buffer
  216. if err := t.Execute(&tpl, sInfo); err != nil {
  217. return doc
  218. }
  219. return tpl.String()
  220. }
  221. func init() {
  222. swag.Register(swag.Name, &s{})
  223. }