swagger.yaml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. basePath: /api/v1
  2. info:
  3. contact:
  4. email: kptzhu@163.com
  5. name: zhuhongbin
  6. url: https://github.com/kptyun
  7. description: kptyun_service
  8. title: kptyun_service
  9. version: 1.1.2
  10. paths:
  11. /api/v1/menus:
  12. get:
  13. consumes:
  14. - application/json
  15. produces:
  16. - application/json
  17. responses:
  18. "200":
  19. description: '{ "code": 200, "data": {}, "msg": "ok" }'
  20. schema:
  21. type: string
  22. summary: 获取所有菜单
  23. tags:
  24. - menu
  25. post:
  26. consumes:
  27. - application/json
  28. parameters:
  29. - description: name
  30. in: query
  31. name: name
  32. required: true
  33. type: string
  34. - description: path
  35. in: query
  36. name: path
  37. required: true
  38. type: string
  39. produces:
  40. - application/json
  41. responses:
  42. "200":
  43. description: '{ "code": 200, "data": {}, "msg": "ok" }'
  44. schema:
  45. type: string
  46. summary: 增加菜单
  47. tags:
  48. - menu
  49. /api/v1/menus/:
  50. delete:
  51. consumes:
  52. - application/json
  53. parameters:
  54. - description: id
  55. in: path
  56. name: id
  57. required: true
  58. type: string
  59. produces:
  60. - application/json
  61. responses:
  62. "200":
  63. description: '{ "code": 200, "data": {}, "msg": "ok" }'
  64. schema:
  65. type: string
  66. summary: 删除菜单
  67. tags:
  68. - menu
  69. get:
  70. consumes:
  71. - application/json
  72. parameters:
  73. - description: id
  74. in: path
  75. name: id
  76. required: true
  77. type: string
  78. produces:
  79. - application/json
  80. responses:
  81. "200":
  82. description: '{ "code": 200, "data": {}, "msg": "ok" }'
  83. schema:
  84. type: string
  85. summary: 获取单个菜单
  86. tags:
  87. - menu
  88. put:
  89. consumes:
  90. - application/json
  91. parameters:
  92. - description: id
  93. in: path
  94. name: id
  95. required: true
  96. type: string
  97. - description: name
  98. in: query
  99. name: name
  100. required: true
  101. type: string
  102. - description: path
  103. in: query
  104. name: path
  105. required: true
  106. type: string
  107. - description: method
  108. in: query
  109. name: method
  110. required: true
  111. type: string
  112. produces:
  113. - application/json
  114. responses:
  115. "200":
  116. description: '{ "code": 200, "data": {}, "msg": "ok" }'
  117. schema:
  118. type: string
  119. summary: 更新菜单
  120. tags:
  121. - menu
  122. /api/v1/roles:
  123. get:
  124. consumes:
  125. - application/json
  126. produces:
  127. - application/json
  128. responses:
  129. "200":
  130. description: '{ "code": 200, "data": {}, "msg": "ok" }'
  131. schema:
  132. type: string
  133. summary: 获取所有角色
  134. tags:
  135. - role
  136. post:
  137. consumes:
  138. - application/json
  139. parameters:
  140. - description: name
  141. in: query
  142. name: name
  143. required: true
  144. type: string
  145. - description: menu_id
  146. in: query
  147. name: menu_id
  148. required: true
  149. type: string
  150. produces:
  151. - application/json
  152. responses:
  153. "200":
  154. description: '{ "code": 200, "data": {}, "msg": "ok" }'
  155. schema:
  156. type: string
  157. summary: 增加角色
  158. tags:
  159. - role
  160. /api/v1/roles/:
  161. delete:
  162. consumes:
  163. - application/json
  164. parameters:
  165. - description: id
  166. in: path
  167. name: id
  168. required: true
  169. type: string
  170. produces:
  171. - application/json
  172. responses:
  173. "200":
  174. description: '{ "code": 200, "data": {}, "msg": "ok" }'
  175. schema:
  176. type: string
  177. summary: 删除角色
  178. tags:
  179. - role
  180. get:
  181. consumes:
  182. - application/json
  183. parameters:
  184. - description: id
  185. in: path
  186. name: id
  187. required: true
  188. type: string
  189. produces:
  190. - application/json
  191. responses:
  192. "200":
  193. description: '{ "code": 200, "data": {}, "msg": "ok" }'
  194. schema:
  195. type: string
  196. summary: 获取单个角色
  197. tags:
  198. - role
  199. put:
  200. consumes:
  201. - application/json
  202. parameters:
  203. - description: id
  204. in: path
  205. name: id
  206. required: true
  207. type: string
  208. - description: name
  209. in: query
  210. name: name
  211. required: true
  212. type: string
  213. - description: menu_id
  214. in: query
  215. name: menu_id
  216. required: true
  217. type: string
  218. produces:
  219. - application/json
  220. responses:
  221. "200":
  222. description: '{ "code": 200, "data": {}, "msg": "ok" }'
  223. schema:
  224. type: string
  225. summary: 更新角色
  226. tags:
  227. - role
  228. /api/v1/users:
  229. get:
  230. consumes:
  231. - application/json
  232. parameters:
  233. - {}
  234. produces:
  235. - application/json
  236. responses:
  237. "200":
  238. description: '{ "code": 200, "data": {}, "msg": "ok" }'
  239. schema:
  240. type: string
  241. summary: 获取所有用户
  242. tags:
  243. - users
  244. post:
  245. consumes:
  246. - application/json
  247. parameters:
  248. - description: username
  249. in: body
  250. name: username
  251. required: true
  252. schema:
  253. type: object
  254. - description: password
  255. in: body
  256. name: password
  257. required: true
  258. schema:
  259. type: object
  260. - description: role_id
  261. in: path
  262. name: role_id
  263. type: integer
  264. produces:
  265. - application/json
  266. responses:
  267. "200":
  268. description: '{ "code": 200, "data": {}, "msg": "ok" }'
  269. schema:
  270. type: string
  271. summary: 增加用户
  272. tags:
  273. - users
  274. /api/v1/users/:
  275. delete:
  276. consumes:
  277. - application/json
  278. parameters:
  279. - description: id
  280. in: path
  281. name: id
  282. required: true
  283. type: integer
  284. produces:
  285. - application/json
  286. responses:
  287. "200":
  288. description: '{ "code": 200, "data": {}, "msg": "ok" }'
  289. schema:
  290. type: string
  291. summary: 删除用户
  292. tags:
  293. - users
  294. get:
  295. consumes:
  296. - application/json
  297. parameters:
  298. - description: id
  299. in: path
  300. name: id
  301. required: true
  302. type: integer
  303. produces:
  304. - application/json
  305. responses:
  306. "200":
  307. description: '{ "code": 200, "data": {}, "msg": "ok" }'
  308. schema:
  309. type: string
  310. summary: 获取单个用户信息
  311. tags:
  312. - users
  313. put:
  314. consumes:
  315. - application/json
  316. parameters:
  317. - {}
  318. - {}
  319. - description: role_id
  320. in: query
  321. name: role_id
  322. type: integer
  323. produces:
  324. - application/json
  325. responses:
  326. "200":
  327. description: '{ "code": 200, "data": {}, "msg": "ok" }'
  328. schema:
  329. type: string
  330. summary: 更新用户
  331. tags:
  332. - users
  333. /auth:
  334. post:
  335. consumes:
  336. - application/json
  337. parameters:
  338. - description: username
  339. in: path
  340. name: username
  341. required: true
  342. type: string
  343. - description: password
  344. in: path
  345. name: password
  346. required: true
  347. type: string
  348. produces:
  349. - application/json
  350. responses:
  351. "200":
  352. description: '{ "code": 200, "data": { "token": "xxx" }, "msg": "ok" }'
  353. schema:
  354. type: string
  355. "400":
  356. description: '{"code":400, "data":null,"msg":"请求参数错误"}'
  357. schema:
  358. type: string
  359. "404":
  360. description: '{ "code": 404, "data":null,"msg":"请求参数错误"}'
  361. schema:
  362. type: string
  363. summary: 获取登录token 信息
  364. tags:
  365. - auth
  366. swagger: "2.0"