sys-api.ts 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. /* tslint:disable */
  2. /* eslint-disable */
  3. /**
  4. * GoView
  5. * GoView 是一个高效的拖拽式低代码数据可视化开发平台,将图表或页面元素封装为基础组件,无需编写代码即可制作数据大屏,减少心智负担。<br/><u><b><font color='FF0000'> 👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!</font></b></u>
  6. *
  7. * OpenAPI spec version: 2.2.8
  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 { GoViewLoginInput } from '../models';
  20. import { GoViewResultGoViewLoginOutput } from '../models';
  21. /**
  22. * SysApi - axios parameter creator
  23. * @export
  24. */
  25. export const SysApiAxiosParamCreator = function (configuration?: Configuration) {
  26. return {
  27. /**
  28. *
  29. * @summary GoView 登录 🔖
  30. * @param {GoViewLoginInput} [body]
  31. * @param {*} [options] Override http request option.
  32. * @throws {RequiredError}
  33. */
  34. apiGoviewSysLoginPost: async (body?: GoViewLoginInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
  35. const localVarPath = `/api/goview/sys/login`;
  36. // use dummy base URL string because the URL constructor only accepts absolute URLs.
  37. const localVarUrlObj = new URL(localVarPath, 'https://example.com');
  38. let baseOptions;
  39. if (configuration) {
  40. baseOptions = configuration.baseOptions;
  41. }
  42. const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
  43. const localVarHeaderParameter = {} as any;
  44. const localVarQueryParameter = {} as any;
  45. // authentication Bearer required
  46. // http bearer authentication required
  47. if (configuration && configuration.accessToken) {
  48. const accessToken = typeof configuration.accessToken === 'function'
  49. ? await configuration.accessToken()
  50. : await configuration.accessToken;
  51. localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
  52. }
  53. localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
  54. const query = new URLSearchParams(localVarUrlObj.search);
  55. for (const key in localVarQueryParameter) {
  56. query.set(key, localVarQueryParameter[key]);
  57. }
  58. for (const key in options.params) {
  59. query.set(key, options.params[key]);
  60. }
  61. localVarUrlObj.search = (new URLSearchParams(query)).toString();
  62. let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
  63. localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
  64. const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
  65. localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
  66. return {
  67. url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
  68. options: localVarRequestOptions,
  69. };
  70. },
  71. /**
  72. *
  73. * @summary GoView 退出 🔖
  74. * @param {*} [options] Override http request option.
  75. * @throws {RequiredError}
  76. */
  77. apiGoviewSysLogoutGet: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
  78. const localVarPath = `/api/goview/sys/logout`;
  79. // use dummy base URL string because the URL constructor only accepts absolute URLs.
  80. const localVarUrlObj = new URL(localVarPath, 'https://example.com');
  81. let baseOptions;
  82. if (configuration) {
  83. baseOptions = configuration.baseOptions;
  84. }
  85. const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
  86. const localVarHeaderParameter = {} as any;
  87. const localVarQueryParameter = {} as any;
  88. // authentication Bearer required
  89. // http bearer authentication required
  90. if (configuration && configuration.accessToken) {
  91. const accessToken = typeof configuration.accessToken === 'function'
  92. ? await configuration.accessToken()
  93. : await configuration.accessToken;
  94. localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
  95. }
  96. const query = new URLSearchParams(localVarUrlObj.search);
  97. for (const key in localVarQueryParameter) {
  98. query.set(key, localVarQueryParameter[key]);
  99. }
  100. for (const key in options.params) {
  101. query.set(key, options.params[key]);
  102. }
  103. localVarUrlObj.search = (new URLSearchParams(query)).toString();
  104. let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
  105. localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
  106. return {
  107. url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
  108. options: localVarRequestOptions,
  109. };
  110. },
  111. }
  112. };
  113. /**
  114. * SysApi - functional programming interface
  115. * @export
  116. */
  117. export const SysApiFp = function(configuration?: Configuration) {
  118. return {
  119. /**
  120. *
  121. * @summary GoView 登录 🔖
  122. * @param {GoViewLoginInput} [body]
  123. * @param {*} [options] Override http request option.
  124. * @throws {RequiredError}
  125. */
  126. async apiGoviewSysLoginPost(body?: GoViewLoginInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<GoViewResultGoViewLoginOutput>>> {
  127. const localVarAxiosArgs = await SysApiAxiosParamCreator(configuration).apiGoviewSysLoginPost(body, options);
  128. return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
  129. const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
  130. return axios.request(axiosRequestArgs);
  131. };
  132. },
  133. /**
  134. *
  135. * @summary GoView 退出 🔖
  136. * @param {*} [options] Override http request option.
  137. * @throws {RequiredError}
  138. */
  139. async apiGoviewSysLogoutGet(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
  140. const localVarAxiosArgs = await SysApiAxiosParamCreator(configuration).apiGoviewSysLogoutGet(options);
  141. return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
  142. const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
  143. return axios.request(axiosRequestArgs);
  144. };
  145. },
  146. }
  147. };
  148. /**
  149. * SysApi - factory interface
  150. * @export
  151. */
  152. export const SysApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
  153. return {
  154. /**
  155. *
  156. * @summary GoView 登录 🔖
  157. * @param {GoViewLoginInput} [body]
  158. * @param {*} [options] Override http request option.
  159. * @throws {RequiredError}
  160. */
  161. async apiGoviewSysLoginPost(body?: GoViewLoginInput, options?: AxiosRequestConfig): Promise<AxiosResponse<GoViewResultGoViewLoginOutput>> {
  162. return SysApiFp(configuration).apiGoviewSysLoginPost(body, options).then((request) => request(axios, basePath));
  163. },
  164. /**
  165. *
  166. * @summary GoView 退出 🔖
  167. * @param {*} [options] Override http request option.
  168. * @throws {RequiredError}
  169. */
  170. async apiGoviewSysLogoutGet(options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
  171. return SysApiFp(configuration).apiGoviewSysLogoutGet(options).then((request) => request(axios, basePath));
  172. },
  173. };
  174. };
  175. /**
  176. * SysApi - object-oriented interface
  177. * @export
  178. * @class SysApi
  179. * @extends {BaseAPI}
  180. */
  181. export class SysApi extends BaseAPI {
  182. /**
  183. *
  184. * @summary GoView 登录 🔖
  185. * @param {GoViewLoginInput} [body]
  186. * @param {*} [options] Override http request option.
  187. * @throws {RequiredError}
  188. * @memberof SysApi
  189. */
  190. public async apiGoviewSysLoginPost(body?: GoViewLoginInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<GoViewResultGoViewLoginOutput>> {
  191. return SysApiFp(this.configuration).apiGoviewSysLoginPost(body, options).then((request) => request(this.axios, this.basePath));
  192. }
  193. /**
  194. *
  195. * @summary GoView 退出 🔖
  196. * @param {*} [options] Override http request option.
  197. * @throws {RequiredError}
  198. * @memberof SysApi
  199. */
  200. public async apiGoviewSysLogoutGet(options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
  201. return SysApiFp(this.configuration).apiGoviewSysLogoutGet(options).then((request) => request(this.axios, this.basePath));
  202. }
  203. }