sys-sms-api.ts 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  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. * 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. apiSysSmsAliyunSendSmsPhoneNumberPost: 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 apiSysSmsAliyunSendSmsPhoneNumberPost.');
  36. }
  37. const localVarPath = `/api/sysSms/aliyunSendSms/{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. * @summary 发送短信模板
  74. * @param {any} body
  75. * @param {string} phoneNumber
  76. * @param {*} [options] Override http request option.
  77. * @throws {RequiredError}
  78. */
  79. apiSysSmsAliyunSendSmsTemplatePhoneNumberPost: async (body: any, phoneNumber: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
  80. // verify required parameter 'body' is not null or undefined
  81. if (body === null || body === undefined) {
  82. throw new RequiredError('body','Required parameter body was null or undefined when calling apiSysSmsAliyunSendSmsTemplatePhoneNumberPost.');
  83. }
  84. // verify required parameter 'phoneNumber' is not null or undefined
  85. if (phoneNumber === null || phoneNumber === undefined) {
  86. throw new RequiredError('phoneNumber','Required parameter phoneNumber was null or undefined when calling apiSysSmsAliyunSendSmsTemplatePhoneNumberPost.');
  87. }
  88. const localVarPath = `/api/sysSms/aliyunSendSmsTemplate/{phoneNumber}`
  89. .replace(`{${"phoneNumber"}}`, encodeURIComponent(String(phoneNumber)));
  90. // use dummy base URL string because the URL constructor only accepts absolute URLs.
  91. const localVarUrlObj = new URL(localVarPath, 'https://example.com');
  92. let baseOptions;
  93. if (configuration) {
  94. baseOptions = configuration.baseOptions;
  95. }
  96. const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
  97. const localVarHeaderParameter = {} as any;
  98. const localVarQueryParameter = {} as any;
  99. // authentication Bearer required
  100. // http bearer authentication required
  101. if (configuration && configuration.accessToken) {
  102. const accessToken = typeof configuration.accessToken === 'function'
  103. ? await configuration.accessToken()
  104. : await configuration.accessToken;
  105. localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
  106. }
  107. localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
  108. const query = new URLSearchParams(localVarUrlObj.search);
  109. for (const key in localVarQueryParameter) {
  110. query.set(key, localVarQueryParameter[key]);
  111. }
  112. for (const key in options.params) {
  113. query.set(key, options.params[key]);
  114. }
  115. localVarUrlObj.search = (new URLSearchParams(query)).toString();
  116. let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
  117. localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
  118. const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
  119. localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
  120. return {
  121. url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
  122. options: localVarRequestOptions,
  123. };
  124. },
  125. /**
  126. *
  127. * @summary 发送短信 📨
  128. * @param {string} phoneNumber
  129. * @param {*} [options] Override http request option.
  130. * @throws {RequiredError}
  131. */
  132. apiSysSmsSendSmsPhoneNumberPost: async (phoneNumber: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
  133. // verify required parameter 'phoneNumber' is not null or undefined
  134. if (phoneNumber === null || phoneNumber === undefined) {
  135. throw new RequiredError('phoneNumber','Required parameter phoneNumber was null or undefined when calling apiSysSmsSendSmsPhoneNumberPost.');
  136. }
  137. const localVarPath = `/api/sysSms/sendSms/{phoneNumber}`
  138. .replace(`{${"phoneNumber"}}`, encodeURIComponent(String(phoneNumber)));
  139. // use dummy base URL string because the URL constructor only accepts absolute URLs.
  140. const localVarUrlObj = new URL(localVarPath, 'https://example.com');
  141. let baseOptions;
  142. if (configuration) {
  143. baseOptions = configuration.baseOptions;
  144. }
  145. const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
  146. const localVarHeaderParameter = {} as any;
  147. const localVarQueryParameter = {} as any;
  148. // authentication Bearer required
  149. // http bearer authentication required
  150. if (configuration && configuration.accessToken) {
  151. const accessToken = typeof configuration.accessToken === 'function'
  152. ? await configuration.accessToken()
  153. : await configuration.accessToken;
  154. localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
  155. }
  156. const query = new URLSearchParams(localVarUrlObj.search);
  157. for (const key in localVarQueryParameter) {
  158. query.set(key, localVarQueryParameter[key]);
  159. }
  160. for (const key in options.params) {
  161. query.set(key, options.params[key]);
  162. }
  163. localVarUrlObj.search = (new URLSearchParams(query)).toString();
  164. let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
  165. localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
  166. return {
  167. url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
  168. options: localVarRequestOptions,
  169. };
  170. },
  171. /**
  172. *
  173. * @summary 腾讯云发送短信 📨
  174. * @param {string} phoneNumber
  175. * @param {*} [options] Override http request option.
  176. * @throws {RequiredError}
  177. */
  178. apiSysSmsTencentSendSmsPhoneNumberPost: async (phoneNumber: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
  179. // verify required parameter 'phoneNumber' is not null or undefined
  180. if (phoneNumber === null || phoneNumber === undefined) {
  181. throw new RequiredError('phoneNumber','Required parameter phoneNumber was null or undefined when calling apiSysSmsTencentSendSmsPhoneNumberPost.');
  182. }
  183. const localVarPath = `/api/sysSms/tencentSendSms/{phoneNumber}`
  184. .replace(`{${"phoneNumber"}}`, encodeURIComponent(String(phoneNumber)));
  185. // use dummy base URL string because the URL constructor only accepts absolute URLs.
  186. const localVarUrlObj = new URL(localVarPath, 'https://example.com');
  187. let baseOptions;
  188. if (configuration) {
  189. baseOptions = configuration.baseOptions;
  190. }
  191. const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
  192. const localVarHeaderParameter = {} as any;
  193. const localVarQueryParameter = {} as any;
  194. // authentication Bearer required
  195. // http bearer authentication required
  196. if (configuration && configuration.accessToken) {
  197. const accessToken = typeof configuration.accessToken === 'function'
  198. ? await configuration.accessToken()
  199. : await configuration.accessToken;
  200. localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
  201. }
  202. const query = new URLSearchParams(localVarUrlObj.search);
  203. for (const key in localVarQueryParameter) {
  204. query.set(key, localVarQueryParameter[key]);
  205. }
  206. for (const key in options.params) {
  207. query.set(key, options.params[key]);
  208. }
  209. localVarUrlObj.search = (new URLSearchParams(query)).toString();
  210. let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
  211. localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
  212. return {
  213. url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
  214. options: localVarRequestOptions,
  215. };
  216. },
  217. }
  218. };
  219. /**
  220. * SysSmsApi - functional programming interface
  221. * @export
  222. */
  223. export const SysSmsApiFp = function(configuration?: Configuration) {
  224. return {
  225. /**
  226. *
  227. * @summary 阿里云发送短信 📨
  228. * @param {string} phoneNumber
  229. * @param {*} [options] Override http request option.
  230. * @throws {RequiredError}
  231. */
  232. async apiSysSmsAliyunSendSmsPhoneNumberPost(phoneNumber: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
  233. const localVarAxiosArgs = await SysSmsApiAxiosParamCreator(configuration).apiSysSmsAliyunSendSmsPhoneNumberPost(phoneNumber, options);
  234. return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
  235. const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
  236. return axios.request(axiosRequestArgs);
  237. };
  238. },
  239. /**
  240. *
  241. * @summary 发送短信模板
  242. * @param {any} body
  243. * @param {string} phoneNumber
  244. * @param {*} [options] Override http request option.
  245. * @throws {RequiredError}
  246. */
  247. async apiSysSmsAliyunSendSmsTemplatePhoneNumberPost(body: any, phoneNumber: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
  248. const localVarAxiosArgs = await SysSmsApiAxiosParamCreator(configuration).apiSysSmsAliyunSendSmsTemplatePhoneNumberPost(body, phoneNumber, options);
  249. return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
  250. const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
  251. return axios.request(axiosRequestArgs);
  252. };
  253. },
  254. /**
  255. *
  256. * @summary 发送短信 📨
  257. * @param {string} phoneNumber
  258. * @param {*} [options] Override http request option.
  259. * @throws {RequiredError}
  260. */
  261. async apiSysSmsSendSmsPhoneNumberPost(phoneNumber: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
  262. const localVarAxiosArgs = await SysSmsApiAxiosParamCreator(configuration).apiSysSmsSendSmsPhoneNumberPost(phoneNumber, options);
  263. return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
  264. const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
  265. return axios.request(axiosRequestArgs);
  266. };
  267. },
  268. /**
  269. *
  270. * @summary 腾讯云发送短信 📨
  271. * @param {string} phoneNumber
  272. * @param {*} [options] Override http request option.
  273. * @throws {RequiredError}
  274. */
  275. async apiSysSmsTencentSendSmsPhoneNumberPost(phoneNumber: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
  276. const localVarAxiosArgs = await SysSmsApiAxiosParamCreator(configuration).apiSysSmsTencentSendSmsPhoneNumberPost(phoneNumber, options);
  277. return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
  278. const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
  279. return axios.request(axiosRequestArgs);
  280. };
  281. },
  282. }
  283. };
  284. /**
  285. * SysSmsApi - factory interface
  286. * @export
  287. */
  288. export const SysSmsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
  289. return {
  290. /**
  291. *
  292. * @summary 阿里云发送短信 📨
  293. * @param {string} phoneNumber
  294. * @param {*} [options] Override http request option.
  295. * @throws {RequiredError}
  296. */
  297. async apiSysSmsAliyunSendSmsPhoneNumberPost(phoneNumber: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
  298. return SysSmsApiFp(configuration).apiSysSmsAliyunSendSmsPhoneNumberPost(phoneNumber, options).then((request) => request(axios, basePath));
  299. },
  300. /**
  301. *
  302. * @summary 发送短信模板
  303. * @param {any} body
  304. * @param {string} phoneNumber
  305. * @param {*} [options] Override http request option.
  306. * @throws {RequiredError}
  307. */
  308. async apiSysSmsAliyunSendSmsTemplatePhoneNumberPost(body: any, phoneNumber: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
  309. return SysSmsApiFp(configuration).apiSysSmsAliyunSendSmsTemplatePhoneNumberPost(body, phoneNumber, options).then((request) => request(axios, basePath));
  310. },
  311. /**
  312. *
  313. * @summary 发送短信 📨
  314. * @param {string} phoneNumber
  315. * @param {*} [options] Override http request option.
  316. * @throws {RequiredError}
  317. */
  318. async apiSysSmsSendSmsPhoneNumberPost(phoneNumber: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
  319. return SysSmsApiFp(configuration).apiSysSmsSendSmsPhoneNumberPost(phoneNumber, options).then((request) => request(axios, basePath));
  320. },
  321. /**
  322. *
  323. * @summary 腾讯云发送短信 📨
  324. * @param {string} phoneNumber
  325. * @param {*} [options] Override http request option.
  326. * @throws {RequiredError}
  327. */
  328. async apiSysSmsTencentSendSmsPhoneNumberPost(phoneNumber: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
  329. return SysSmsApiFp(configuration).apiSysSmsTencentSendSmsPhoneNumberPost(phoneNumber, options).then((request) => request(axios, basePath));
  330. },
  331. };
  332. };
  333. /**
  334. * SysSmsApi - object-oriented interface
  335. * @export
  336. * @class SysSmsApi
  337. * @extends {BaseAPI}
  338. */
  339. export class SysSmsApi extends BaseAPI {
  340. /**
  341. *
  342. * @summary 阿里云发送短信 📨
  343. * @param {string} phoneNumber
  344. * @param {*} [options] Override http request option.
  345. * @throws {RequiredError}
  346. * @memberof SysSmsApi
  347. */
  348. public async apiSysSmsAliyunSendSmsPhoneNumberPost(phoneNumber: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
  349. return SysSmsApiFp(this.configuration).apiSysSmsAliyunSendSmsPhoneNumberPost(phoneNumber, options).then((request) => request(this.axios, this.basePath));
  350. }
  351. /**
  352. *
  353. * @summary 发送短信模板
  354. * @param {any} body
  355. * @param {string} phoneNumber
  356. * @param {*} [options] Override http request option.
  357. * @throws {RequiredError}
  358. * @memberof SysSmsApi
  359. */
  360. public async apiSysSmsAliyunSendSmsTemplatePhoneNumberPost(body: any, phoneNumber: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
  361. return SysSmsApiFp(this.configuration).apiSysSmsAliyunSendSmsTemplatePhoneNumberPost(body, phoneNumber, options).then((request) => request(this.axios, this.basePath));
  362. }
  363. /**
  364. *
  365. * @summary 发送短信 📨
  366. * @param {string} phoneNumber
  367. * @param {*} [options] Override http request option.
  368. * @throws {RequiredError}
  369. * @memberof SysSmsApi
  370. */
  371. public async apiSysSmsSendSmsPhoneNumberPost(phoneNumber: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
  372. return SysSmsApiFp(this.configuration).apiSysSmsSendSmsPhoneNumberPost(phoneNumber, options).then((request) => request(this.axios, this.basePath));
  373. }
  374. /**
  375. *
  376. * @summary 腾讯云发送短信 📨
  377. * @param {string} phoneNumber
  378. * @param {*} [options] Override http request option.
  379. * @throws {RequiredError}
  380. * @memberof SysSmsApi
  381. */
  382. public async apiSysSmsTencentSendSmsPhoneNumberPost(phoneNumber: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
  383. return SysSmsApiFp(this.configuration).apiSysSmsTencentSendSmsPhoneNumberPost(phoneNumber, options).then((request) => request(this.axios, this.basePath));
  384. }
  385. }