sys-sms-api.ts 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. /* tslint:disable */
  2. /* eslint-disable */
  3. /**
  4. * Admin.NET 通用权限开发平台
  5. * 让 .NET 开发更简单、更通用、更流行。前后端分离架构(.NET6/Vue3),开箱即用紧随前沿技术。<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. /**
  20. * SysSmsApi - axios parameter creator
  21. * @export
  22. */
  23. export const SysSmsApiAxiosParamCreator = function (configuration?: Configuration) {
  24. return {
  25. /**
  26. *
  27. * @summary 发送短信 📨
  28. * @param {string} phoneNumber
  29. * @param {*} [options] Override http request option.
  30. * @throws {RequiredError}
  31. */
  32. apiSysSmsSendSmsPhoneNumberPost: async (phoneNumber: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
  33. // verify required parameter 'phoneNumber' is not null or undefined
  34. if (phoneNumber === null || phoneNumber === undefined) {
  35. throw new RequiredError('phoneNumber','Required parameter phoneNumber was null or undefined when calling apiSysSmsSendSmsPhoneNumberPost.');
  36. }
  37. const localVarPath = `/api/sysSms/sendSms/{phoneNumber}`
  38. .replace(`{${"phoneNumber"}}`, encodeURIComponent(String(phoneNumber)));
  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. const query = new URLSearchParams(localVarUrlObj.search);
  57. for (const key in localVarQueryParameter) {
  58. query.set(key, localVarQueryParameter[key]);
  59. }
  60. for (const key in options.params) {
  61. query.set(key, options.params[key]);
  62. }
  63. localVarUrlObj.search = (new URLSearchParams(query)).toString();
  64. let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
  65. localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
  66. return {
  67. url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
  68. options: localVarRequestOptions,
  69. };
  70. },
  71. }
  72. };
  73. /**
  74. * SysSmsApi - functional programming interface
  75. * @export
  76. */
  77. export const SysSmsApiFp = function(configuration?: Configuration) {
  78. return {
  79. /**
  80. *
  81. * @summary 发送短信 📨
  82. * @param {string} phoneNumber
  83. * @param {*} [options] Override http request option.
  84. * @throws {RequiredError}
  85. */
  86. async apiSysSmsSendSmsPhoneNumberPost(phoneNumber: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
  87. const localVarAxiosArgs = await SysSmsApiAxiosParamCreator(configuration).apiSysSmsSendSmsPhoneNumberPost(phoneNumber, options);
  88. return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
  89. const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
  90. return axios.request(axiosRequestArgs);
  91. };
  92. },
  93. }
  94. };
  95. /**
  96. * SysSmsApi - factory interface
  97. * @export
  98. */
  99. export const SysSmsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
  100. return {
  101. /**
  102. *
  103. * @summary 发送短信 📨
  104. * @param {string} phoneNumber
  105. * @param {*} [options] Override http request option.
  106. * @throws {RequiredError}
  107. */
  108. async apiSysSmsSendSmsPhoneNumberPost(phoneNumber: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
  109. return SysSmsApiFp(configuration).apiSysSmsSendSmsPhoneNumberPost(phoneNumber, options).then((request) => request(axios, basePath));
  110. },
  111. };
  112. };
  113. /**
  114. * SysSmsApi - object-oriented interface
  115. * @export
  116. * @class SysSmsApi
  117. * @extends {BaseAPI}
  118. */
  119. export class SysSmsApi extends BaseAPI {
  120. /**
  121. *
  122. * @summary 发送短信 📨
  123. * @param {string} phoneNumber
  124. * @param {*} [options] Override http request option.
  125. * @throws {RequiredError}
  126. * @memberof SysSmsApi
  127. */
  128. public async apiSysSmsSendSmsPhoneNumberPost(phoneNumber: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
  129. return SysSmsApiFp(this.configuration).apiSysSmsSendSmsPhoneNumberPost(phoneNumber, options).then((request) => request(this.axios, this.basePath));
  130. }
  131. }