sys-org-api.ts 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419
  1. /* tslint:disable */
  2. /* eslint-disable */
  3. /**
  4. * Admin.NET 通用权限开发平台
  5. * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。<br/><br/>👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,均与作者无关!
  6. *
  7. * OpenAPI spec version: 1.0.0
  8. *
  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. // http bearer authentication required
  50. if (configuration && configuration.accessToken) {
  51. const accessToken = typeof configuration.accessToken === 'function'
  52. ? await configuration.accessToken()
  53. : await configuration.accessToken;
  54. localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
  55. }
  56. localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
  57. const query = new URLSearchParams(localVarUrlObj.search);
  58. for (const key in localVarQueryParameter) {
  59. query.set(key, localVarQueryParameter[key]);
  60. }
  61. for (const key in options.params) {
  62. query.set(key, options.params[key]);
  63. }
  64. localVarUrlObj.search = (new URLSearchParams(query)).toString();
  65. let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
  66. localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
  67. const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
  68. localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
  69. return {
  70. url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
  71. options: localVarRequestOptions,
  72. };
  73. },
  74. /**
  75. *
  76. * @summary 删除机构
  77. * @param {DeleteOrgInput} [body]
  78. * @param {*} [options] Override http request option.
  79. * @throws {RequiredError}
  80. */
  81. apiSysOrgDeletePost: async (body?: DeleteOrgInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
  82. const localVarPath = `/api/sysOrg/delete`;
  83. // use dummy base URL string because the URL constructor only accepts absolute URLs.
  84. const localVarUrlObj = new URL(localVarPath, 'https://example.com');
  85. let baseOptions;
  86. if (configuration) {
  87. baseOptions = configuration.baseOptions;
  88. }
  89. const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
  90. const localVarHeaderParameter = {} as any;
  91. const localVarQueryParameter = {} as any;
  92. // authentication Bearer required
  93. // http bearer authentication required
  94. if (configuration && configuration.accessToken) {
  95. const accessToken = typeof configuration.accessToken === 'function'
  96. ? await configuration.accessToken()
  97. : await configuration.accessToken;
  98. localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
  99. }
  100. localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
  101. const query = new URLSearchParams(localVarUrlObj.search);
  102. for (const key in localVarQueryParameter) {
  103. query.set(key, localVarQueryParameter[key]);
  104. }
  105. for (const key in options.params) {
  106. query.set(key, options.params[key]);
  107. }
  108. localVarUrlObj.search = (new URLSearchParams(query)).toString();
  109. let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
  110. localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
  111. const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
  112. localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
  113. return {
  114. url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
  115. options: localVarRequestOptions,
  116. };
  117. },
  118. /**
  119. *
  120. * @summary 获取机构列表
  121. * @param {number} id 主键Id
  122. * @param {string} [name] 名称
  123. * @param {string} [code] 编码
  124. * @param {string} [type] 机构类型
  125. * @param {*} [options] Override http request option.
  126. * @throws {RequiredError}
  127. */
  128. apiSysOrgListGet: async (id: number, name?: string, code?: string, type?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
  129. // verify required parameter 'id' is not null or undefined
  130. if (id === null || id === undefined) {
  131. throw new RequiredError('id','Required parameter id was null or undefined when calling apiSysOrgListGet.');
  132. }
  133. const localVarPath = `/api/sysOrg/list`;
  134. // use dummy base URL string because the URL constructor only accepts absolute URLs.
  135. const localVarUrlObj = new URL(localVarPath, 'https://example.com');
  136. let baseOptions;
  137. if (configuration) {
  138. baseOptions = configuration.baseOptions;
  139. }
  140. const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
  141. const localVarHeaderParameter = {} as any;
  142. const localVarQueryParameter = {} as any;
  143. // authentication Bearer required
  144. // http bearer authentication required
  145. if (configuration && configuration.accessToken) {
  146. const accessToken = typeof configuration.accessToken === 'function'
  147. ? await configuration.accessToken()
  148. : await configuration.accessToken;
  149. localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
  150. }
  151. if (name !== undefined) {
  152. localVarQueryParameter['Name'] = name;
  153. }
  154. if (code !== undefined) {
  155. localVarQueryParameter['Code'] = code;
  156. }
  157. if (type !== undefined) {
  158. localVarQueryParameter['Type'] = type;
  159. }
  160. if (id !== undefined) {
  161. localVarQueryParameter['Id'] = id;
  162. }
  163. const query = new URLSearchParams(localVarUrlObj.search);
  164. for (const key in localVarQueryParameter) {
  165. query.set(key, localVarQueryParameter[key]);
  166. }
  167. for (const key in options.params) {
  168. query.set(key, options.params[key]);
  169. }
  170. localVarUrlObj.search = (new URLSearchParams(query)).toString();
  171. let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
  172. localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
  173. return {
  174. url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
  175. options: localVarRequestOptions,
  176. };
  177. },
  178. /**
  179. *
  180. * @summary 更新机构
  181. * @param {UpdateOrgInput} [body]
  182. * @param {*} [options] Override http request option.
  183. * @throws {RequiredError}
  184. */
  185. apiSysOrgUpdatePost: async (body?: UpdateOrgInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
  186. const localVarPath = `/api/sysOrg/update`;
  187. // use dummy base URL string because the URL constructor only accepts absolute URLs.
  188. const localVarUrlObj = new URL(localVarPath, 'https://example.com');
  189. let baseOptions;
  190. if (configuration) {
  191. baseOptions = configuration.baseOptions;
  192. }
  193. const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
  194. const localVarHeaderParameter = {} as any;
  195. const localVarQueryParameter = {} as any;
  196. // authentication Bearer required
  197. // http bearer authentication required
  198. if (configuration && configuration.accessToken) {
  199. const accessToken = typeof configuration.accessToken === 'function'
  200. ? await configuration.accessToken()
  201. : await configuration.accessToken;
  202. localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
  203. }
  204. localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
  205. const query = new URLSearchParams(localVarUrlObj.search);
  206. for (const key in localVarQueryParameter) {
  207. query.set(key, localVarQueryParameter[key]);
  208. }
  209. for (const key in options.params) {
  210. query.set(key, options.params[key]);
  211. }
  212. localVarUrlObj.search = (new URLSearchParams(query)).toString();
  213. let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
  214. localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
  215. const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
  216. localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
  217. return {
  218. url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
  219. options: localVarRequestOptions,
  220. };
  221. },
  222. }
  223. };
  224. /**
  225. * SysOrgApi - functional programming interface
  226. * @export
  227. */
  228. export const SysOrgApiFp = function(configuration?: Configuration) {
  229. return {
  230. /**
  231. *
  232. * @summary 增加机构
  233. * @param {AddOrgInput} [body]
  234. * @param {*} [options] Override http request option.
  235. * @throws {RequiredError}
  236. */
  237. async apiSysOrgAddPost(body?: AddOrgInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultInt64>>> {
  238. const localVarAxiosArgs = await SysOrgApiAxiosParamCreator(configuration).apiSysOrgAddPost(body, options);
  239. return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
  240. const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
  241. return axios.request(axiosRequestArgs);
  242. };
  243. },
  244. /**
  245. *
  246. * @summary 删除机构
  247. * @param {DeleteOrgInput} [body]
  248. * @param {*} [options] Override http request option.
  249. * @throws {RequiredError}
  250. */
  251. async apiSysOrgDeletePost(body?: DeleteOrgInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
  252. const localVarAxiosArgs = await SysOrgApiAxiosParamCreator(configuration).apiSysOrgDeletePost(body, options);
  253. return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
  254. const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
  255. return axios.request(axiosRequestArgs);
  256. };
  257. },
  258. /**
  259. *
  260. * @summary 获取机构列表
  261. * @param {number} id 主键Id
  262. * @param {string} [name] 名称
  263. * @param {string} [code] 编码
  264. * @param {string} [type] 机构类型
  265. * @param {*} [options] Override http request option.
  266. * @throws {RequiredError}
  267. */
  268. async apiSysOrgListGet(id: number, name?: string, code?: string, type?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultListSysOrg>>> {
  269. const localVarAxiosArgs = await SysOrgApiAxiosParamCreator(configuration).apiSysOrgListGet(id, name, code, type, options);
  270. return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
  271. const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
  272. return axios.request(axiosRequestArgs);
  273. };
  274. },
  275. /**
  276. *
  277. * @summary 更新机构
  278. * @param {UpdateOrgInput} [body]
  279. * @param {*} [options] Override http request option.
  280. * @throws {RequiredError}
  281. */
  282. async apiSysOrgUpdatePost(body?: UpdateOrgInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
  283. const localVarAxiosArgs = await SysOrgApiAxiosParamCreator(configuration).apiSysOrgUpdatePost(body, options);
  284. return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
  285. const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
  286. return axios.request(axiosRequestArgs);
  287. };
  288. },
  289. }
  290. };
  291. /**
  292. * SysOrgApi - factory interface
  293. * @export
  294. */
  295. export const SysOrgApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
  296. return {
  297. /**
  298. *
  299. * @summary 增加机构
  300. * @param {AddOrgInput} [body]
  301. * @param {*} [options] Override http request option.
  302. * @throws {RequiredError}
  303. */
  304. async apiSysOrgAddPost(body?: AddOrgInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultInt64>> {
  305. return SysOrgApiFp(configuration).apiSysOrgAddPost(body, options).then((request) => request(axios, basePath));
  306. },
  307. /**
  308. *
  309. * @summary 删除机构
  310. * @param {DeleteOrgInput} [body]
  311. * @param {*} [options] Override http request option.
  312. * @throws {RequiredError}
  313. */
  314. async apiSysOrgDeletePost(body?: DeleteOrgInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
  315. return SysOrgApiFp(configuration).apiSysOrgDeletePost(body, options).then((request) => request(axios, basePath));
  316. },
  317. /**
  318. *
  319. * @summary 获取机构列表
  320. * @param {number} id 主键Id
  321. * @param {string} [name] 名称
  322. * @param {string} [code] 编码
  323. * @param {string} [type] 机构类型
  324. * @param {*} [options] Override http request option.
  325. * @throws {RequiredError}
  326. */
  327. async apiSysOrgListGet(id: number, name?: string, code?: string, type?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultListSysOrg>> {
  328. return SysOrgApiFp(configuration).apiSysOrgListGet(id, name, code, type, options).then((request) => request(axios, basePath));
  329. },
  330. /**
  331. *
  332. * @summary 更新机构
  333. * @param {UpdateOrgInput} [body]
  334. * @param {*} [options] Override http request option.
  335. * @throws {RequiredError}
  336. */
  337. async apiSysOrgUpdatePost(body?: UpdateOrgInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
  338. return SysOrgApiFp(configuration).apiSysOrgUpdatePost(body, options).then((request) => request(axios, basePath));
  339. },
  340. };
  341. };
  342. /**
  343. * SysOrgApi - object-oriented interface
  344. * @export
  345. * @class SysOrgApi
  346. * @extends {BaseAPI}
  347. */
  348. export class SysOrgApi extends BaseAPI {
  349. /**
  350. *
  351. * @summary 增加机构
  352. * @param {AddOrgInput} [body]
  353. * @param {*} [options] Override http request option.
  354. * @throws {RequiredError}
  355. * @memberof SysOrgApi
  356. */
  357. public async apiSysOrgAddPost(body?: AddOrgInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultInt64>> {
  358. return SysOrgApiFp(this.configuration).apiSysOrgAddPost(body, options).then((request) => request(this.axios, this.basePath));
  359. }
  360. /**
  361. *
  362. * @summary 删除机构
  363. * @param {DeleteOrgInput} [body]
  364. * @param {*} [options] Override http request option.
  365. * @throws {RequiredError}
  366. * @memberof SysOrgApi
  367. */
  368. public async apiSysOrgDeletePost(body?: DeleteOrgInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
  369. return SysOrgApiFp(this.configuration).apiSysOrgDeletePost(body, options).then((request) => request(this.axios, this.basePath));
  370. }
  371. /**
  372. *
  373. * @summary 获取机构列表
  374. * @param {number} id 主键Id
  375. * @param {string} [name] 名称
  376. * @param {string} [code] 编码
  377. * @param {string} [type] 机构类型
  378. * @param {*} [options] Override http request option.
  379. * @throws {RequiredError}
  380. * @memberof SysOrgApi
  381. */
  382. public async apiSysOrgListGet(id: number, name?: string, code?: string, type?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultListSysOrg>> {
  383. return SysOrgApiFp(this.configuration).apiSysOrgListGet(id, name, code, type, options).then((request) => request(this.axios, this.basePath));
  384. }
  385. /**
  386. *
  387. * @summary 更新机构
  388. * @param {UpdateOrgInput} [body]
  389. * @param {*} [options] Override http request option.
  390. * @throws {RequiredError}
  391. * @memberof SysOrgApi
  392. */
  393. public async apiSysOrgUpdatePost(body?: UpdateOrgInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
  394. return SysOrgApiFp(this.configuration).apiSysOrgUpdatePost(body, options).then((request) => request(this.axios, this.basePath));
  395. }
  396. }