api.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. import service from '@/utils/request'
  2. // @Tags api
  3. // @Summary 分页获取角色列表
  4. // @Security ApiKeyAuth
  5. // @accept application/json
  6. // @Produce application/json
  7. // @Param data body modelInterface.PageInfo true "分页获取用户列表"
  8. // @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
  9. // @Router /api/getApiList [post]
  10. // {
  11. // page int
  12. // pageSize int
  13. // }
  14. export const getApiList = (data) => {
  15. return service({
  16. url: '/api/getApiList',
  17. method: 'post',
  18. data
  19. })
  20. }
  21. // @Tags Api
  22. // @Summary 创建基础api
  23. // @Security ApiKeyAuth
  24. // @accept application/json
  25. // @Produce application/json
  26. // @Param data body api.CreateApiParams true "创建api"
  27. // @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
  28. // @Router /api/createApi [post]
  29. export const createApi = (data) => {
  30. return service({
  31. url: '/api/createApi',
  32. method: 'post',
  33. data
  34. })
  35. }
  36. // @Tags menu
  37. // @Summary 根据id获取菜单
  38. // @Security ApiKeyAuth
  39. // @accept application/json
  40. // @Produce application/json
  41. // @Param data body api.GetById true "根据id获取菜单"
  42. // @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
  43. // @Router /menu/getApiById [post]
  44. export const getApiById = (data) => {
  45. return service({
  46. url: '/api/getApiById',
  47. method: 'post',
  48. data
  49. })
  50. }
  51. // @Tags Api
  52. // @Summary 更新api
  53. // @Security ApiKeyAuth
  54. // @accept application/json
  55. // @Produce application/json
  56. // @Param data body api.CreateApiParams true "更新api"
  57. // @Success 200 {string} json "{"success":true,"data":{},"msg":"更新成功"}"
  58. // @Router /api/updateApi [post]
  59. export const updateApi = (data) => {
  60. return service({
  61. url: '/api/updateApi',
  62. method: 'post',
  63. data
  64. })
  65. }
  66. // @Tags Api
  67. // @Summary 更新api
  68. // @Security ApiKeyAuth
  69. // @accept application/json
  70. // @Produce application/json
  71. // @Param data body api.CreateApiParams true "更新api"
  72. // @Success 200 {string} json "{"success":true,"data":{},"msg":"更新成功"}"
  73. // @Router /api/setAuthApi [post]
  74. export const setAuthApi = (data) => {
  75. return service({
  76. url: '/api/setAuthApi',
  77. method: 'post',
  78. data
  79. })
  80. }
  81. // @Tags Api
  82. // @Summary 获取所有的Api 不分页
  83. // @Security ApiKeyAuth
  84. // @accept application/json
  85. // @Produce application/json
  86. // @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
  87. // @Router /api/getAllApis [post]
  88. export const getAllApis = (data) => {
  89. return service({
  90. url: '/api/getAllApis',
  91. method: 'post',
  92. data
  93. })
  94. }
  95. // @Tags Api
  96. // @Summary 删除指定api
  97. // @Security ApiKeyAuth
  98. // @accept application/json
  99. // @Produce application/json
  100. // @Param data body dbModel.Api true "删除api"
  101. // @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
  102. // @Router /api/deleteApi [post]
  103. export const deleteApi = (data) => {
  104. return service({
  105. url: '/api/deleteApi',
  106. method: 'post',
  107. data
  108. })
  109. }
  110. // @Tags SysApi
  111. // @Summary 删除选中Api
  112. // @Security ApiKeyAuth
  113. // @accept application/json
  114. // @Produce application/json
  115. // @Param data body request.IdsReq true "ID"
  116. // @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
  117. // @Router /api/deleteApisByIds [delete]
  118. export const deleteApisByIds = (data) => {
  119. return service({
  120. url: '/api/deleteApisByIds',
  121. method: 'delete',
  122. data
  123. })
  124. }