Api.ts 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. /* eslint-disable */
  2. /* tslint:disable */
  3. /*
  4. * ---------------------------------------------------------------
  5. * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
  6. * ## ##
  7. * ## AUTHOR: acacode ##
  8. * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
  9. * ---------------------------------------------------------------
  10. */
  11. import { AxiosResponse } from 'axios'
  12. import {
  13. ApiAddInput,
  14. ApiSyncInput,
  15. ApiUpdateInput,
  16. PageInputApiGetPageDto,
  17. ResultOutputApiGetOutput,
  18. ResultOutputInt64,
  19. ResultOutputListApiListOutput,
  20. ResultOutputPageOutputApiEntity,
  21. } from './data-contracts'
  22. import { ContentType, HttpClient, RequestParams } from './http-client'
  23. export class Api<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
  24. /**
  25. * No description
  26. *
  27. * @tags api
  28. * @name Get
  29. * @summary 查询接口
  30. * @request GET:/api/admin/api/get
  31. * @secure
  32. */
  33. get = (
  34. query?: {
  35. /** @format int64 */
  36. id?: number
  37. },
  38. params: RequestParams = {}
  39. ) =>
  40. this.request<ResultOutputApiGetOutput, any>({
  41. path: `/api/admin/api/get`,
  42. method: 'GET',
  43. query: query,
  44. secure: true,
  45. format: 'json',
  46. ...params,
  47. })
  48. /**
  49. * No description
  50. *
  51. * @tags api
  52. * @name GetList
  53. * @summary 查询列表
  54. * @request GET:/api/admin/api/get-list
  55. * @secure
  56. */
  57. getList = (
  58. query?: {
  59. key?: string
  60. },
  61. params: RequestParams = {}
  62. ) =>
  63. this.request<ResultOutputListApiListOutput, any>({
  64. path: `/api/admin/api/get-list`,
  65. method: 'GET',
  66. query: query,
  67. secure: true,
  68. format: 'json',
  69. ...params,
  70. })
  71. /**
  72. * No description
  73. *
  74. * @tags api
  75. * @name GetPage
  76. * @summary 查询分页
  77. * @request POST:/api/admin/api/get-page
  78. * @secure
  79. */
  80. getPage = (data: PageInputApiGetPageDto, params: RequestParams = {}) =>
  81. this.request<ResultOutputPageOutputApiEntity, any>({
  82. path: `/api/admin/api/get-page`,
  83. method: 'POST',
  84. body: data,
  85. secure: true,
  86. type: ContentType.Json,
  87. format: 'json',
  88. ...params,
  89. })
  90. /**
  91. * No description
  92. *
  93. * @tags api
  94. * @name Add
  95. * @summary 添加
  96. * @request POST:/api/admin/api/add
  97. * @secure
  98. */
  99. add = (data: ApiAddInput, params: RequestParams = {}) =>
  100. this.request<ResultOutputInt64, any>({
  101. path: `/api/admin/api/add`,
  102. method: 'POST',
  103. body: data,
  104. secure: true,
  105. type: ContentType.Json,
  106. format: 'json',
  107. ...params,
  108. })
  109. /**
  110. * No description
  111. *
  112. * @tags api
  113. * @name Update
  114. * @summary 修改
  115. * @request PUT:/api/admin/api/update
  116. * @secure
  117. */
  118. update = (data: ApiUpdateInput, params: RequestParams = {}) =>
  119. this.request<AxiosResponse, any>({
  120. path: `/api/admin/api/update`,
  121. method: 'PUT',
  122. body: data,
  123. secure: true,
  124. type: ContentType.Json,
  125. ...params,
  126. })
  127. /**
  128. * No description
  129. *
  130. * @tags api
  131. * @name Delete
  132. * @summary 彻底删除
  133. * @request DELETE:/api/admin/api/delete
  134. * @secure
  135. */
  136. delete = (
  137. query?: {
  138. /** @format int64 */
  139. id?: number
  140. },
  141. params: RequestParams = {}
  142. ) =>
  143. this.request<AxiosResponse, any>({
  144. path: `/api/admin/api/delete`,
  145. method: 'DELETE',
  146. query: query,
  147. secure: true,
  148. ...params,
  149. })
  150. /**
  151. * No description
  152. *
  153. * @tags api
  154. * @name SoftDelete
  155. * @summary 删除
  156. * @request DELETE:/api/admin/api/soft-delete
  157. * @secure
  158. */
  159. softDelete = (
  160. query?: {
  161. /** @format int64 */
  162. id?: number
  163. },
  164. params: RequestParams = {}
  165. ) =>
  166. this.request<AxiosResponse, any>({
  167. path: `/api/admin/api/soft-delete`,
  168. method: 'DELETE',
  169. query: query,
  170. secure: true,
  171. ...params,
  172. })
  173. /**
  174. * No description
  175. *
  176. * @tags api
  177. * @name BatchSoftDelete
  178. * @summary 批量删除
  179. * @request PUT:/api/admin/api/batch-soft-delete
  180. * @secure
  181. */
  182. batchSoftDelete = (data: number[], params: RequestParams = {}) =>
  183. this.request<AxiosResponse, any>({
  184. path: `/api/admin/api/batch-soft-delete`,
  185. method: 'PUT',
  186. body: data,
  187. secure: true,
  188. type: ContentType.Json,
  189. ...params,
  190. })
  191. /**
  192. * No description
  193. *
  194. * @tags api
  195. * @name Sync
  196. * @summary 同步
  197. * @request POST:/api/admin/api/sync
  198. * @secure
  199. */
  200. sync = (data: ApiSyncInput, params: RequestParams = {}) =>
  201. this.request<AxiosResponse, any>({
  202. path: `/api/admin/api/sync`,
  203. method: 'POST',
  204. body: data,
  205. secure: true,
  206. type: ContentType.Json,
  207. ...params,
  208. })
  209. }