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.

426 lines
13 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
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. {
  2. "swagger": "2.0",
  3. "info": {
  4. "description": "This is a sample Server pets",
  5. "title": "Swagger Example API",
  6. "contact": {},
  7. "license": {},
  8. "version": "0.0.1"
  9. },
  10. "basePath": "/",
  11. "paths": {
  12. "/api/createApi": {
  13. "post": {
  14. "security": [
  15. {
  16. "ApiKeyAuth": []
  17. }
  18. ],
  19. "consumes": [
  20. "application/json"
  21. ],
  22. "produces": [
  23. "application/json"
  24. ],
  25. "tags": [
  26. "Api"
  27. ],
  28. "summary": "为指定角色创建api",
  29. "parameters": [
  30. {
  31. "description": "创建api",
  32. "name": "data",
  33. "in": "body",
  34. "required": true,
  35. "schema": {
  36. "type": "object",
  37. "$ref": "#/definitions/api.CreateApiParams"
  38. }
  39. }
  40. ],
  41. "responses": {
  42. "200": {
  43. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  44. "schema": {
  45. "type": "string"
  46. }
  47. }
  48. }
  49. }
  50. },
  51. "/api/deleteApi": {
  52. "post": {
  53. "security": [
  54. {
  55. "ApiKeyAuth": []
  56. }
  57. ],
  58. "consumes": [
  59. "application/json"
  60. ],
  61. "produces": [
  62. "application/json"
  63. ],
  64. "tags": [
  65. "Api"
  66. ],
  67. "summary": "删除指定角色api",
  68. "parameters": [
  69. {
  70. "description": "删除api",
  71. "name": "data",
  72. "in": "body",
  73. "required": true,
  74. "schema": {
  75. "type": "object",
  76. "$ref": "#/definitions/api.DeleteApiParams"
  77. }
  78. }
  79. ],
  80. "responses": {
  81. "200": {
  82. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  83. "schema": {
  84. "type": "string"
  85. }
  86. }
  87. }
  88. }
  89. },
  90. "/authority/createAuthority": {
  91. "post": {
  92. "security": [
  93. {
  94. "ApiKeyAuth": []
  95. }
  96. ],
  97. "consumes": [
  98. "application/json"
  99. ],
  100. "produces": [
  101. "application/json"
  102. ],
  103. "tags": [
  104. "authority"
  105. ],
  106. "summary": "创建角色",
  107. "parameters": [
  108. {
  109. "description": "创建角色",
  110. "name": "data",
  111. "in": "body",
  112. "required": true,
  113. "schema": {
  114. "type": "object",
  115. "$ref": "#/definitions/api.CreateAuthorityPatams"
  116. }
  117. }
  118. ],
  119. "responses": {
  120. "200": {
  121. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  122. "schema": {
  123. "type": "string"
  124. }
  125. }
  126. }
  127. }
  128. },
  129. "/authority/deleteAuthority": {
  130. "post": {
  131. "security": [
  132. {
  133. "ApiKeyAuth": []
  134. }
  135. ],
  136. "consumes": [
  137. "application/json"
  138. ],
  139. "produces": [
  140. "application/json"
  141. ],
  142. "tags": [
  143. "authority"
  144. ],
  145. "summary": "删除角色",
  146. "parameters": [
  147. {
  148. "description": "删除角色",
  149. "name": "data",
  150. "in": "body",
  151. "required": true,
  152. "schema": {
  153. "type": "object",
  154. "$ref": "#/definitions/api.DeleteAuthorityPatams"
  155. }
  156. }
  157. ],
  158. "responses": {
  159. "200": {
  160. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  161. "schema": {
  162. "type": "string"
  163. }
  164. }
  165. }
  166. }
  167. },
  168. "/base/login": {
  169. "post": {
  170. "produces": [
  171. "application/json"
  172. ],
  173. "tags": [
  174. "Base"
  175. ],
  176. "summary": "用户登录",
  177. "parameters": [
  178. {
  179. "description": "用户登录接口",
  180. "name": "data",
  181. "in": "body",
  182. "required": true,
  183. "schema": {
  184. "type": "object",
  185. "$ref": "#/definitions/api.RegistAndLoginStuct"
  186. }
  187. }
  188. ],
  189. "responses": {
  190. "200": {
  191. "description": "{\"success\":true,\"data\":{},\"msg\":\"登陆成功\"}",
  192. "schema": {
  193. "type": "string"
  194. }
  195. }
  196. }
  197. }
  198. },
  199. "/base/regist": {
  200. "post": {
  201. "produces": [
  202. "application/json"
  203. ],
  204. "tags": [
  205. "Base"
  206. ],
  207. "summary": "用户注册账号",
  208. "parameters": [
  209. {
  210. "description": "用户注册接口",
  211. "name": "data",
  212. "in": "body",
  213. "required": true,
  214. "schema": {
  215. "type": "object",
  216. "$ref": "#/definitions/api.RegistAndLoginStuct"
  217. }
  218. }
  219. ],
  220. "responses": {
  221. "200": {
  222. "description": "{\"success\":true,\"data\":{},\"msg\":\"注册成功\"}",
  223. "schema": {
  224. "type": "string"
  225. }
  226. }
  227. }
  228. }
  229. },
  230. "/user/changePassword": {
  231. "post": {
  232. "security": [
  233. {
  234. "ApiKeyAuth": []
  235. }
  236. ],
  237. "produces": [
  238. "application/json"
  239. ],
  240. "tags": [
  241. "User"
  242. ],
  243. "summary": "用户修改密码",
  244. "parameters": [
  245. {
  246. "description": "用户修改密码",
  247. "name": "data",
  248. "in": "body",
  249. "required": true,
  250. "schema": {
  251. "type": "object",
  252. "$ref": "#/definitions/api.ChangePasswordStutrc"
  253. }
  254. }
  255. ],
  256. "responses": {
  257. "200": {
  258. "description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}",
  259. "schema": {
  260. "type": "string"
  261. }
  262. }
  263. }
  264. }
  265. },
  266. "/user/getInfoList": {
  267. "post": {
  268. "security": [
  269. {
  270. "ApiKeyAuth": []
  271. }
  272. ],
  273. "consumes": [
  274. "application/json"
  275. ],
  276. "produces": [
  277. "application/json"
  278. ],
  279. "tags": [
  280. "User"
  281. ],
  282. "summary": "分页获取用户列表",
  283. "parameters": [
  284. {
  285. "description": "分页获取用户列表",
  286. "name": "data",
  287. "in": "body",
  288. "required": true,
  289. "schema": {
  290. "type": "object",
  291. "$ref": "#/definitions/modelInterface.PageInfo"
  292. }
  293. }
  294. ],
  295. "responses": {
  296. "200": {
  297. "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}",
  298. "schema": {
  299. "type": "string"
  300. }
  301. }
  302. }
  303. }
  304. },
  305. "/user/uploadHeaderImg": {
  306. "post": {
  307. "security": [
  308. {
  309. "ApiKeyAuth": []
  310. }
  311. ],
  312. "consumes": [
  313. "multipart/form-data"
  314. ],
  315. "produces": [
  316. "application/json"
  317. ],
  318. "tags": [
  319. "User"
  320. ],
  321. "summary": "用户上传头像",
  322. "parameters": [
  323. {
  324. "type": "file",
  325. "description": "用户上传头像",
  326. "name": "headerImg",
  327. "in": "formData",
  328. "required": true
  329. },
  330. {
  331. "type": "string",
  332. "description": "用户上传头像",
  333. "name": "username",
  334. "in": "formData",
  335. "required": true
  336. }
  337. ],
  338. "responses": {
  339. "200": {
  340. "description": "{\"success\":true,\"data\":{},\"msg\":\"上传成功\"}",
  341. "schema": {
  342. "type": "string"
  343. }
  344. }
  345. }
  346. }
  347. }
  348. },
  349. "definitions": {
  350. "api.ChangePasswordStutrc": {
  351. "type": "object",
  352. "properties": {
  353. "newPassword": {
  354. "type": "string"
  355. },
  356. "password": {
  357. "type": "string"
  358. },
  359. "username": {
  360. "type": "string"
  361. }
  362. }
  363. },
  364. "api.CreateApiParams": {
  365. "type": "object",
  366. "properties": {
  367. "description": {
  368. "type": "string"
  369. },
  370. "path": {
  371. "type": "string"
  372. }
  373. }
  374. },
  375. "api.CreateAuthorityPatams": {
  376. "type": "object",
  377. "properties": {
  378. "authorityId": {
  379. "type": "integer"
  380. },
  381. "authorityName": {
  382. "type": "string"
  383. }
  384. }
  385. },
  386. "api.DeleteApiParams": {
  387. "type": "object"
  388. },
  389. "api.DeleteAuthorityPatams": {
  390. "type": "object",
  391. "properties": {
  392. "authorityId": {
  393. "type": "integer"
  394. }
  395. }
  396. },
  397. "api.RegistAndLoginStuct": {
  398. "type": "object",
  399. "properties": {
  400. "password": {
  401. "type": "string"
  402. },
  403. "username": {
  404. "type": "string"
  405. }
  406. }
  407. },
  408. "modelInterface.PageInfo": {
  409. "type": "object",
  410. "properties": {
  411. "page": {
  412. "type": "integer"
  413. },
  414. "pageSize": {
  415. "type": "integer"
  416. }
  417. }
  418. }
  419. },
  420. "securityDefinitions": {
  421. "ApiKeyAuth": {
  422. "type": "apiKey",
  423. "name": "x-token",
  424. "in": "header"
  425. }
  426. }
  427. }