sys-email-api.ts 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. /* tslint:disable */
  2. /* eslint-disable */
  3. /**
  4. * Admin.NET 通用权限开发平台
  5. * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。<br/><u><b><font color='FF0000'> 👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任!</font></b></u>
  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. /**
  20. * SysEmailApi - axios parameter creator
  21. * @export
  22. */
  23. export const SysEmailApiAxiosParamCreator = function (configuration?: Configuration) {
  24. return {
  25. /**
  26. *
  27. * @summary 发送邮件 📧
  28. * @param {string} content
  29. * @param {string} title
  30. * @param {*} [options] Override http request option.
  31. * @throws {RequiredError}
  32. */
  33. apiSysEmailSendEmailContentTitlePost: async (content: string, title: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
  34. // verify required parameter 'content' is not null or undefined
  35. if (content === null || content === undefined) {
  36. throw new RequiredError('content','Required parameter content was null or undefined when calling apiSysEmailSendEmailContentTitlePost.');
  37. }
  38. // verify required parameter 'title' is not null or undefined
  39. if (title === null || title === undefined) {
  40. throw new RequiredError('title','Required parameter title was null or undefined when calling apiSysEmailSendEmailContentTitlePost.');
  41. }
  42. const localVarPath = `/api/sysEmail/sendEmail/{content}/{title}`
  43. .replace(`{${"content"}}`, encodeURIComponent(String(content)))
  44. .replace(`{${"title"}}`, encodeURIComponent(String(title)));
  45. // use dummy base URL string because the URL constructor only accepts absolute URLs.
  46. const localVarUrlObj = new URL(localVarPath, 'https://example.com');
  47. let baseOptions;
  48. if (configuration) {
  49. baseOptions = configuration.baseOptions;
  50. }
  51. const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
  52. const localVarHeaderParameter = {} as any;
  53. const localVarQueryParameter = {} as any;
  54. // authentication Bearer required
  55. // http bearer authentication required
  56. if (configuration && configuration.accessToken) {
  57. const accessToken = typeof configuration.accessToken === 'function'
  58. ? await configuration.accessToken()
  59. : await configuration.accessToken;
  60. localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
  61. }
  62. const query = new URLSearchParams(localVarUrlObj.search);
  63. for (const key in localVarQueryParameter) {
  64. query.set(key, localVarQueryParameter[key]);
  65. }
  66. for (const key in options.params) {
  67. query.set(key, options.params[key]);
  68. }
  69. localVarUrlObj.search = (new URLSearchParams(query)).toString();
  70. let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
  71. localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
  72. return {
  73. url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
  74. options: localVarRequestOptions,
  75. };
  76. },
  77. }
  78. };
  79. /**
  80. * SysEmailApi - functional programming interface
  81. * @export
  82. */
  83. export const SysEmailApiFp = function(configuration?: Configuration) {
  84. return {
  85. /**
  86. *
  87. * @summary 发送邮件 📧
  88. * @param {string} content
  89. * @param {string} title
  90. * @param {*} [options] Override http request option.
  91. * @throws {RequiredError}
  92. */
  93. async apiSysEmailSendEmailContentTitlePost(content: string, title: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
  94. const localVarAxiosArgs = await SysEmailApiAxiosParamCreator(configuration).apiSysEmailSendEmailContentTitlePost(content, title, options);
  95. return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
  96. const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
  97. return axios.request(axiosRequestArgs);
  98. };
  99. },
  100. }
  101. };
  102. /**
  103. * SysEmailApi - factory interface
  104. * @export
  105. */
  106. export const SysEmailApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
  107. return {
  108. /**
  109. *
  110. * @summary 发送邮件 📧
  111. * @param {string} content
  112. * @param {string} title
  113. * @param {*} [options] Override http request option.
  114. * @throws {RequiredError}
  115. */
  116. async apiSysEmailSendEmailContentTitlePost(content: string, title: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
  117. return SysEmailApiFp(configuration).apiSysEmailSendEmailContentTitlePost(content, title, options).then((request) => request(axios, basePath));
  118. },
  119. };
  120. };
  121. /**
  122. * SysEmailApi - object-oriented interface
  123. * @export
  124. * @class SysEmailApi
  125. * @extends {BaseAPI}
  126. */
  127. export class SysEmailApi extends BaseAPI {
  128. /**
  129. *
  130. * @summary 发送邮件 📧
  131. * @param {string} content
  132. * @param {string} title
  133. * @param {*} [options] Override http request option.
  134. * @throws {RequiredError}
  135. * @memberof SysEmailApi
  136. */
  137. public async apiSysEmailSendEmailContentTitlePost(content: string, title: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
  138. return SysEmailApiFp(this.configuration).apiSysEmailSendEmailContentTitlePost(content, title, options).then((request) => request(this.axios, this.basePath));
  139. }
  140. }