sys-org-api.ts 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  1. /* tslint:disable */
  2. /* eslint-disable */
  3. /**
  4. * 所有接口
  5. * 让 .NET 开发更简单、更通用、更流行。前后端分离架构(.NET6/Vue3),开箱即用紧随前沿技术。<br/><a href='https://gitee.com/zuohuaijun/Admin.NET/'>https://gitee.com/zuohuaijun/Admin.NET</a>
  6. *
  7. * OpenAPI spec version: 1.0.0
  8. * Contact: 515096995@qq.com
  9. *
  10. * NOTE: This class is auto generated by the swagger code generator program.
  11. * https://github.com/swagger-api/swagger-codegen.git
  12. * Do not edit the class manually.
  13. */
  14. import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios';
  15. import { Configuration } from '../configuration';
  16. // Some imports not used depending on template conditions
  17. // @ts-ignore
  18. import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
  19. import { AddOrgInput } from '../models';
  20. import { AdminResultInt64 } from '../models';
  21. import { AdminResultListSysOrg } from '../models';
  22. import { DeleteOrgInput } from '../models';
  23. import { UpdateOrgInput } from '../models';
  24. /**
  25. * SysOrgApi - axios parameter creator
  26. * @export
  27. */
  28. export const SysOrgApiAxiosParamCreator = function (configuration?: Configuration) {
  29. return {
  30. /**
  31. *
  32. * @summary 增加机构
  33. * @param {AddOrgInput} [body]
  34. * @param {*} [options] Override http request option.
  35. * @throws {RequiredError}
  36. */
  37. apiSysOrgAddPost: async (body?: AddOrgInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
  38. const localVarPath = `/api/sysOrg/add`;
  39. // use dummy base URL string because the URL constructor only accepts absolute URLs.
  40. const localVarUrlObj = new URL(localVarPath, 'https://example.com');
  41. let baseOptions;
  42. if (configuration) {
  43. baseOptions = configuration.baseOptions;
  44. }
  45. const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
  46. const localVarHeaderParameter = {} as any;
  47. const localVarQueryParameter = {} as any;
  48. // authentication Bearer required
  49. localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
  50. const query = new URLSearchParams(localVarUrlObj.search);
  51. for (const key in localVarQueryParameter) {
  52. query.set(key, localVarQueryParameter[key]);
  53. }
  54. for (const key in options.params) {
  55. query.set(key, options.params[key]);
  56. }
  57. localVarUrlObj.search = (new URLSearchParams(query)).toString();
  58. let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
  59. localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
  60. const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
  61. localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
  62. return {
  63. url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
  64. options: localVarRequestOptions,
  65. };
  66. },
  67. /**
  68. *
  69. * @summary 删除机构
  70. * @param {DeleteOrgInput} [body]
  71. * @param {*} [options] Override http request option.
  72. * @throws {RequiredError}
  73. */
  74. apiSysOrgDeletePost: async (body?: DeleteOrgInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
  75. const localVarPath = `/api/sysOrg/delete`;
  76. // use dummy base URL string because the URL constructor only accepts absolute URLs.
  77. const localVarUrlObj = new URL(localVarPath, 'https://example.com');
  78. let baseOptions;
  79. if (configuration) {
  80. baseOptions = configuration.baseOptions;
  81. }
  82. const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
  83. const localVarHeaderParameter = {} as any;
  84. const localVarQueryParameter = {} as any;
  85. // authentication Bearer required
  86. localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
  87. const query = new URLSearchParams(localVarUrlObj.search);
  88. for (const key in localVarQueryParameter) {
  89. query.set(key, localVarQueryParameter[key]);
  90. }
  91. for (const key in options.params) {
  92. query.set(key, options.params[key]);
  93. }
  94. localVarUrlObj.search = (new URLSearchParams(query)).toString();
  95. let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
  96. localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
  97. const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
  98. localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
  99. return {
  100. url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
  101. options: localVarRequestOptions,
  102. };
  103. },
  104. /**
  105. *
  106. * @summary 获取机构列表
  107. * @param {number} id 主键Id
  108. * @param {string} [name] 名称
  109. * @param {string} [code] 编码
  110. * @param {*} [options] Override http request option.
  111. * @throws {RequiredError}
  112. */
  113. apiSysOrgListGet: async (id: number, name?: string, code?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
  114. // verify required parameter 'id' is not null or undefined
  115. if (id === null || id === undefined) {
  116. throw new RequiredError('id','Required parameter id was null or undefined when calling apiSysOrgListGet.');
  117. }
  118. const localVarPath = `/api/sysOrg/list`;
  119. // use dummy base URL string because the URL constructor only accepts absolute URLs.
  120. const localVarUrlObj = new URL(localVarPath, 'https://example.com');
  121. let baseOptions;
  122. if (configuration) {
  123. baseOptions = configuration.baseOptions;
  124. }
  125. const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
  126. const localVarHeaderParameter = {} as any;
  127. const localVarQueryParameter = {} as any;
  128. // authentication Bearer required
  129. if (name !== undefined) {
  130. localVarQueryParameter['Name'] = name;
  131. }
  132. if (code !== undefined) {
  133. localVarQueryParameter['Code'] = code;
  134. }
  135. if (id !== undefined) {
  136. localVarQueryParameter['Id'] = id;
  137. }
  138. const query = new URLSearchParams(localVarUrlObj.search);
  139. for (const key in localVarQueryParameter) {
  140. query.set(key, localVarQueryParameter[key]);
  141. }
  142. for (const key in options.params) {
  143. query.set(key, options.params[key]);
  144. }
  145. localVarUrlObj.search = (new URLSearchParams(query)).toString();
  146. let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
  147. localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
  148. return {
  149. url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
  150. options: localVarRequestOptions,
  151. };
  152. },
  153. /**
  154. *
  155. * @summary 更新机构
  156. * @param {UpdateOrgInput} [body]
  157. * @param {*} [options] Override http request option.
  158. * @throws {RequiredError}
  159. */
  160. apiSysOrgUpdatePost: async (body?: UpdateOrgInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
  161. const localVarPath = `/api/sysOrg/update`;
  162. // use dummy base URL string because the URL constructor only accepts absolute URLs.
  163. const localVarUrlObj = new URL(localVarPath, 'https://example.com');
  164. let baseOptions;
  165. if (configuration) {
  166. baseOptions = configuration.baseOptions;
  167. }
  168. const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
  169. const localVarHeaderParameter = {} as any;
  170. const localVarQueryParameter = {} as any;
  171. // authentication Bearer required
  172. localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
  173. const query = new URLSearchParams(localVarUrlObj.search);
  174. for (const key in localVarQueryParameter) {
  175. query.set(key, localVarQueryParameter[key]);
  176. }
  177. for (const key in options.params) {
  178. query.set(key, options.params[key]);
  179. }
  180. localVarUrlObj.search = (new URLSearchParams(query)).toString();
  181. let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
  182. localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
  183. const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
  184. localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
  185. return {
  186. url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
  187. options: localVarRequestOptions,
  188. };
  189. },
  190. }
  191. };
  192. /**
  193. * SysOrgApi - functional programming interface
  194. * @export
  195. */
  196. export const SysOrgApiFp = function(configuration?: Configuration) {
  197. return {
  198. /**
  199. *
  200. * @summary 增加机构
  201. * @param {AddOrgInput} [body]
  202. * @param {*} [options] Override http request option.
  203. * @throws {RequiredError}
  204. */
  205. async apiSysOrgAddPost(body?: AddOrgInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultInt64>>> {
  206. const localVarAxiosArgs = await SysOrgApiAxiosParamCreator(configuration).apiSysOrgAddPost(body, options);
  207. return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
  208. const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
  209. return axios.request(axiosRequestArgs);
  210. };
  211. },
  212. /**
  213. *
  214. * @summary 删除机构
  215. * @param {DeleteOrgInput} [body]
  216. * @param {*} [options] Override http request option.
  217. * @throws {RequiredError}
  218. */
  219. async apiSysOrgDeletePost(body?: DeleteOrgInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
  220. const localVarAxiosArgs = await SysOrgApiAxiosParamCreator(configuration).apiSysOrgDeletePost(body, options);
  221. return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
  222. const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
  223. return axios.request(axiosRequestArgs);
  224. };
  225. },
  226. /**
  227. *
  228. * @summary 获取机构列表
  229. * @param {number} id 主键Id
  230. * @param {string} [name] 名称
  231. * @param {string} [code] 编码
  232. * @param {*} [options] Override http request option.
  233. * @throws {RequiredError}
  234. */
  235. async apiSysOrgListGet(id: number, name?: string, code?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListSysOrg>>> {
  236. const localVarAxiosArgs = await SysOrgApiAxiosParamCreator(configuration).apiSysOrgListGet(id, name, code, options);
  237. return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
  238. const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
  239. return axios.request(axiosRequestArgs);
  240. };
  241. },
  242. /**
  243. *
  244. * @summary 更新机构
  245. * @param {UpdateOrgInput} [body]
  246. * @param {*} [options] Override http request option.
  247. * @throws {RequiredError}
  248. */
  249. async apiSysOrgUpdatePost(body?: UpdateOrgInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
  250. const localVarAxiosArgs = await SysOrgApiAxiosParamCreator(configuration).apiSysOrgUpdatePost(body, options);
  251. return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
  252. const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
  253. return axios.request(axiosRequestArgs);
  254. };
  255. },
  256. }
  257. };
  258. /**
  259. * SysOrgApi - factory interface
  260. * @export
  261. */
  262. export const SysOrgApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
  263. return {
  264. /**
  265. *
  266. * @summary 增加机构
  267. * @param {AddOrgInput} [body]
  268. * @param {*} [options] Override http request option.
  269. * @throws {RequiredError}
  270. */
  271. async apiSysOrgAddPost(body?: AddOrgInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultInt64>> {
  272. return SysOrgApiFp(configuration).apiSysOrgAddPost(body, options).then((request) => request(axios, basePath));
  273. },
  274. /**
  275. *
  276. * @summary 删除机构
  277. * @param {DeleteOrgInput} [body]
  278. * @param {*} [options] Override http request option.
  279. * @throws {RequiredError}
  280. */
  281. async apiSysOrgDeletePost(body?: DeleteOrgInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
  282. return SysOrgApiFp(configuration).apiSysOrgDeletePost(body, options).then((request) => request(axios, basePath));
  283. },
  284. /**
  285. *
  286. * @summary 获取机构列表
  287. * @param {number} id 主键Id
  288. * @param {string} [name] 名称
  289. * @param {string} [code] 编码
  290. * @param {*} [options] Override http request option.
  291. * @throws {RequiredError}
  292. */
  293. async apiSysOrgListGet(id: number, name?: string, code?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListSysOrg>> {
  294. return SysOrgApiFp(configuration).apiSysOrgListGet(id, name, code, options).then((request) => request(axios, basePath));
  295. },
  296. /**
  297. *
  298. * @summary 更新机构
  299. * @param {UpdateOrgInput} [body]
  300. * @param {*} [options] Override http request option.
  301. * @throws {RequiredError}
  302. */
  303. async apiSysOrgUpdatePost(body?: UpdateOrgInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
  304. return SysOrgApiFp(configuration).apiSysOrgUpdatePost(body, options).then((request) => request(axios, basePath));
  305. },
  306. };
  307. };
  308. /**
  309. * SysOrgApi - object-oriented interface
  310. * @export
  311. * @class SysOrgApi
  312. * @extends {BaseAPI}
  313. */
  314. export class SysOrgApi extends BaseAPI {
  315. /**
  316. *
  317. * @summary 增加机构
  318. * @param {AddOrgInput} [body]
  319. * @param {*} [options] Override http request option.
  320. * @throws {RequiredError}
  321. * @memberof SysOrgApi
  322. */
  323. public async apiSysOrgAddPost(body?: AddOrgInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultInt64>> {
  324. return SysOrgApiFp(this.configuration).apiSysOrgAddPost(body, options).then((request) => request(this.axios, this.basePath));
  325. }
  326. /**
  327. *
  328. * @summary 删除机构
  329. * @param {DeleteOrgInput} [body]
  330. * @param {*} [options] Override http request option.
  331. * @throws {RequiredError}
  332. * @memberof SysOrgApi
  333. */
  334. public async apiSysOrgDeletePost(body?: DeleteOrgInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
  335. return SysOrgApiFp(this.configuration).apiSysOrgDeletePost(body, options).then((request) => request(this.axios, this.basePath));
  336. }
  337. /**
  338. *
  339. * @summary 获取机构列表
  340. * @param {number} id 主键Id
  341. * @param {string} [name] 名称
  342. * @param {string} [code] 编码
  343. * @param {*} [options] Override http request option.
  344. * @throws {RequiredError}
  345. * @memberof SysOrgApi
  346. */
  347. public async apiSysOrgListGet(id: number, name?: string, code?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListSysOrg>> {
  348. return SysOrgApiFp(this.configuration).apiSysOrgListGet(id, name, code, options).then((request) => request(this.axios, this.basePath));
  349. }
  350. /**
  351. *
  352. * @summary 更新机构
  353. * @param {UpdateOrgInput} [body]
  354. * @param {*} [options] Override http request option.
  355. * @throws {RequiredError}
  356. * @memberof SysOrgApi
  357. */
  358. public async apiSysOrgUpdatePost(body?: UpdateOrgInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
  359. return SysOrgApiFp(this.configuration).apiSysOrgUpdatePost(body, options).then((request) => request(this.axios, this.basePath));
  360. }
  361. }