swagger.json 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. {
  2. "swagger": "2.0",
  3. "info": {
  4. "description": "统一登录平台",
  5. "title": "统一登录平台",
  6. "contact": {},
  7. "version": "1.0"
  8. },
  9. "host": "127.0.0.1:8080",
  10. "basePath": "/api",
  11. "paths": {
  12. "/admin/getalluser": {
  13. "post": {
  14. "consumes": [
  15. "application/json"
  16. ],
  17. "tags": [
  18. "用户管理"
  19. ],
  20. "summary": "获取所有用户",
  21. "parameters": [
  22. {
  23. "description": "分页信息",
  24. "name": "req",
  25. "in": "body",
  26. "required": true,
  27. "schema": {
  28. "$ref": "#/definitions/page.PageParams"
  29. }
  30. }
  31. ],
  32. "responses": {
  33. "200": {
  34. "description": "OK",
  35. "schema": {
  36. "$ref": "#/definitions/e.R"
  37. }
  38. }
  39. }
  40. }
  41. },
  42. "/admin/user": {
  43. "post": {
  44. "consumes": [
  45. "application/json"
  46. ],
  47. "tags": [
  48. "用户管理"
  49. ],
  50. "summary": "获取所有用户",
  51. "parameters": [
  52. {
  53. "description": "分页信息",
  54. "name": "req",
  55. "in": "body",
  56. "required": true,
  57. "schema": {
  58. "$ref": "#/definitions/page.PageParams"
  59. }
  60. }
  61. ],
  62. "responses": {
  63. "200": {
  64. "description": "OK",
  65. "schema": {
  66. "$ref": "#/definitions/e.R"
  67. }
  68. }
  69. }
  70. },
  71. "delete": {
  72. "consumes": [
  73. "application/json"
  74. ],
  75. "tags": [
  76. "用户管理"
  77. ],
  78. "summary": "删除用户",
  79. "parameters": [
  80. {
  81. "type": "string",
  82. "description": "id",
  83. "name": "id",
  84. "in": "query",
  85. "required": true
  86. }
  87. ],
  88. "responses": {
  89. "200": {
  90. "description": "OK",
  91. "schema": {
  92. "$ref": "#/definitions/e.R"
  93. }
  94. }
  95. }
  96. }
  97. },
  98. "/codelogin": {
  99. "post": {
  100. "consumes": [
  101. "application/json"
  102. ],
  103. "tags": [
  104. "用户管理"
  105. ],
  106. "summary": "验证码登录",
  107. "parameters": [
  108. {
  109. "description": "账号信息",
  110. "name": "req",
  111. "in": "body",
  112. "required": true,
  113. "schema": {
  114. "$ref": "#/definitions/models.UserRegist"
  115. }
  116. }
  117. ],
  118. "responses": {
  119. "200": {
  120. "description": "OK",
  121. "schema": {
  122. "$ref": "#/definitions/e.R"
  123. }
  124. }
  125. }
  126. }
  127. },
  128. "/sendcode": {
  129. "post": {
  130. "consumes": [
  131. "application/json"
  132. ],
  133. "tags": [
  134. "用户管理"
  135. ],
  136. "summary": "发送验证码",
  137. "parameters": [
  138. {
  139. "type": "string",
  140. "description": "手机号",
  141. "name": "phone",
  142. "in": "query",
  143. "required": true
  144. }
  145. ],
  146. "responses": {
  147. "200": {
  148. "description": "OK",
  149. "schema": {
  150. "$ref": "#/definitions/e.R"
  151. }
  152. }
  153. }
  154. }
  155. },
  156. "/user": {
  157. "post": {
  158. "consumes": [
  159. "application/json"
  160. ],
  161. "tags": [
  162. "用户管理"
  163. ],
  164. "summary": "账号密码登录",
  165. "parameters": [
  166. {
  167. "description": "账号信息",
  168. "name": "req",
  169. "in": "body",
  170. "required": true,
  171. "schema": {
  172. "$ref": "#/definitions/models.UserRegist"
  173. }
  174. }
  175. ],
  176. "responses": {
  177. "200": {
  178. "description": "OK",
  179. "schema": {
  180. "$ref": "#/definitions/e.R"
  181. }
  182. }
  183. }
  184. }
  185. }
  186. },
  187. "definitions": {
  188. "e.R": {
  189. "type": "object",
  190. "properties": {
  191. "code": {
  192. "$ref": "#/definitions/e.Rescode"
  193. },
  194. "data": {},
  195. "message": {}
  196. }
  197. },
  198. "e.Rescode": {
  199. "type": "integer",
  200. "enum": [
  201. 200,
  202. 201,
  203. 1001,
  204. 1002,
  205. 1003,
  206. 1004,
  207. 1005,
  208. 1006,
  209. 1007,
  210. 1008,
  211. 1009,
  212. 1010,
  213. 1011,
  214. 1012,
  215. 1013,
  216. 1014,
  217. 1015,
  218. 1016,
  219. 1017
  220. ],
  221. "x-enum-varnames": [
  222. "SUCCESS",
  223. "ERROR",
  224. "TokenIsInvalid",
  225. "TokenIsExpired",
  226. "DELETEFAIL",
  227. "UPDATEFAIL",
  228. "PaginationFailed",
  229. "JSONParsingFailed",
  230. "TheUserAlreadyExists",
  231. "AlreadyExists",
  232. "TheSystemIsAbnormal",
  233. "CodeIsError",
  234. "Theuseralreadyexists",
  235. "ThePhoneNumberIsWrong",
  236. "AnExceptionOccursWhenSendingAnSMSVerificationCode",
  237. "TokenIsFaild",
  238. "ThePasswordIsWrongOrThePhoneNumberIsIncorrect",
  239. "HasSend",
  240. "TheUserIsEmpty"
  241. ]
  242. },
  243. "models.UserRegist": {
  244. "type": "object",
  245. "required": [
  246. "account",
  247. "code",
  248. "password",
  249. "phone",
  250. "username"
  251. ],
  252. "properties": {
  253. "account": {
  254. "description": "账号",
  255. "type": "string",
  256. "maxLength": 20,
  257. "minLength": 6
  258. },
  259. "code": {
  260. "description": "验证码",
  261. "type": "string",
  262. "maxLength": 6,
  263. "minLength": 6
  264. },
  265. "password": {
  266. "description": "密码",
  267. "type": "string",
  268. "maxLength": 20,
  269. "minLength": 6
  270. },
  271. "phone": {
  272. "description": "手机号",
  273. "type": "string",
  274. "maxLength": 11,
  275. "minLength": 11
  276. },
  277. "username": {
  278. "description": "用户名",
  279. "type": "string",
  280. "maxLength": 20,
  281. "minLength": 2
  282. }
  283. }
  284. },
  285. "page.PageParams": {
  286. "type": "object",
  287. "properties": {
  288. "desc": {
  289. "type": "string"
  290. },
  291. "page": {
  292. "type": "integer"
  293. },
  294. "size": {
  295. "type": "integer"
  296. }
  297. }
  298. }
  299. }
  300. }