sys-wechat-api.ts 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. /* tslint:disable */
  2. /* eslint-disable */
  3. /**
  4. * Admin.NET
  5. * 让 .NET 开发更简单、更通用、更流行。前后端分离架构(.NET6/Vue3),开箱即用紧随前沿技术。<br/><a href='https://gitee.com/zuohuaijun/Admin.NET/'>https://gitee.com/zuohuaijun/Admin.NET</a>
  6. *
  7. * OpenAPI spec version: 1.0.0
  8. * Contact: 515096995@qq.com
  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 { AdminResultObject } from '../models';
  20. import { AdminResultString } from '../models';
  21. import { GenAuthUrlInput } from '../models';
  22. import { SignatureInput } from '../models';
  23. import { WechatUserLogin } from '../models';
  24. /**
  25. * SysWechatApi - axios parameter creator
  26. * @export
  27. */
  28. export const SysWechatApiAxiosParamCreator = function (configuration?: Configuration) {
  29. return {
  30. /**
  31. *
  32. * @summary 生成网页授权Url
  33. * @param {GenAuthUrlInput} [body]
  34. * @param {*} [options] Override http request option.
  35. * @throws {RequiredError}
  36. */
  37. apiSysWechatGenAuthUrlPost: async (body?: GenAuthUrlInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
  38. const localVarPath = `/api/sysWechat/genAuthUrl`;
  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. localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
  50. const query = new URLSearchParams(localVarUrlObj.search);
  51. for (const key in localVarQueryParameter) {
  52. query.set(key, localVarQueryParameter[key]);
  53. }
  54. for (const key in options.params) {
  55. query.set(key, options.params[key]);
  56. }
  57. localVarUrlObj.search = (new URLSearchParams(query)).toString();
  58. let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
  59. localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
  60. const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
  61. localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
  62. return {
  63. url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
  64. options: localVarRequestOptions,
  65. };
  66. },
  67. /**
  68. *
  69. * @summary 获取配置签名参数(wx.config)
  70. * @param {SignatureInput} [body]
  71. * @param {*} [options] Override http request option.
  72. * @throws {RequiredError}
  73. */
  74. apiSysWechatGenConfigParaPost: async (body?: SignatureInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
  75. const localVarPath = `/api/sysWechat/genConfigPara`;
  76. // use dummy base URL string because the URL constructor only accepts absolute URLs.
  77. const localVarUrlObj = new URL(localVarPath, 'https://example.com');
  78. let baseOptions;
  79. if (configuration) {
  80. baseOptions = configuration.baseOptions;
  81. }
  82. const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
  83. const localVarHeaderParameter = {} as any;
  84. const localVarQueryParameter = {} as any;
  85. // authentication Bearer required
  86. localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
  87. const query = new URLSearchParams(localVarUrlObj.search);
  88. for (const key in localVarQueryParameter) {
  89. query.set(key, localVarQueryParameter[key]);
  90. }
  91. for (const key in options.params) {
  92. query.set(key, options.params[key]);
  93. }
  94. localVarUrlObj.search = (new URLSearchParams(query)).toString();
  95. let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
  96. localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
  97. const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
  98. localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
  99. return {
  100. url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
  101. options: localVarRequestOptions,
  102. };
  103. },
  104. /**
  105. *
  106. * @summary 微信用户登录OpenId
  107. * @param {WechatUserLogin} [body]
  108. * @param {*} [options] Override http request option.
  109. * @throws {RequiredError}
  110. */
  111. apiSysWechatOpenIdLoginPost: async (body?: WechatUserLogin, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
  112. const localVarPath = `/api/sysWechat/openIdLogin`;
  113. // use dummy base URL string because the URL constructor only accepts absolute URLs.
  114. const localVarUrlObj = new URL(localVarPath, 'https://example.com');
  115. let baseOptions;
  116. if (configuration) {
  117. baseOptions = configuration.baseOptions;
  118. }
  119. const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
  120. const localVarHeaderParameter = {} as any;
  121. const localVarQueryParameter = {} as any;
  122. // authentication Bearer required
  123. localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
  124. const query = new URLSearchParams(localVarUrlObj.search);
  125. for (const key in localVarQueryParameter) {
  126. query.set(key, localVarQueryParameter[key]);
  127. }
  128. for (const key in options.params) {
  129. query.set(key, options.params[key]);
  130. }
  131. localVarUrlObj.search = (new URLSearchParams(query)).toString();
  132. let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
  133. localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
  134. const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
  135. localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
  136. return {
  137. url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
  138. options: localVarRequestOptions,
  139. };
  140. },
  141. /**
  142. *
  143. * @summary 获取微信用户OpenId
  144. * @param {string} code Code
  145. * @param {*} [options] Override http request option.
  146. * @throws {RequiredError}
  147. */
  148. apiSysWechatSnsOAuth2Post: async (code: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
  149. // verify required parameter 'code' is not null or undefined
  150. if (code === null || code === undefined) {
  151. throw new RequiredError('code','Required parameter code was null or undefined when calling apiSysWechatSnsOAuth2Post.');
  152. }
  153. const localVarPath = `/api/sysWechat/snsOAuth2`;
  154. // use dummy base URL string because the URL constructor only accepts absolute URLs.
  155. const localVarUrlObj = new URL(localVarPath, 'https://example.com');
  156. let baseOptions;
  157. if (configuration) {
  158. baseOptions = configuration.baseOptions;
  159. }
  160. const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
  161. const localVarHeaderParameter = {} as any;
  162. const localVarQueryParameter = {} as any;
  163. // authentication Bearer required
  164. if (code !== undefined) {
  165. localVarQueryParameter['Code'] = code;
  166. }
  167. const query = new URLSearchParams(localVarUrlObj.search);
  168. for (const key in localVarQueryParameter) {
  169. query.set(key, localVarQueryParameter[key]);
  170. }
  171. for (const key in options.params) {
  172. query.set(key, options.params[key]);
  173. }
  174. localVarUrlObj.search = (new URLSearchParams(query)).toString();
  175. let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
  176. localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
  177. return {
  178. url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
  179. options: localVarRequestOptions,
  180. };
  181. },
  182. }
  183. };
  184. /**
  185. * SysWechatApi - functional programming interface
  186. * @export
  187. */
  188. export const SysWechatApiFp = function(configuration?: Configuration) {
  189. return {
  190. /**
  191. *
  192. * @summary 生成网页授权Url
  193. * @param {GenAuthUrlInput} [body]
  194. * @param {*} [options] Override http request option.
  195. * @throws {RequiredError}
  196. */
  197. async apiSysWechatGenAuthUrlPost(body?: GenAuthUrlInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultString>>> {
  198. const localVarAxiosArgs = await SysWechatApiAxiosParamCreator(configuration).apiSysWechatGenAuthUrlPost(body, options);
  199. return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
  200. const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
  201. return axios.request(axiosRequestArgs);
  202. };
  203. },
  204. /**
  205. *
  206. * @summary 获取配置签名参数(wx.config)
  207. * @param {SignatureInput} [body]
  208. * @param {*} [options] Override http request option.
  209. * @throws {RequiredError}
  210. */
  211. async apiSysWechatGenConfigParaPost(body?: SignatureInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultObject>>> {
  212. const localVarAxiosArgs = await SysWechatApiAxiosParamCreator(configuration).apiSysWechatGenConfigParaPost(body, options);
  213. return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
  214. const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
  215. return axios.request(axiosRequestArgs);
  216. };
  217. },
  218. /**
  219. *
  220. * @summary 微信用户登录OpenId
  221. * @param {WechatUserLogin} [body]
  222. * @param {*} [options] Override http request option.
  223. * @throws {RequiredError}
  224. */
  225. async apiSysWechatOpenIdLoginPost(body?: WechatUserLogin, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultObject>>> {
  226. const localVarAxiosArgs = await SysWechatApiAxiosParamCreator(configuration).apiSysWechatOpenIdLoginPost(body, options);
  227. return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
  228. const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
  229. return axios.request(axiosRequestArgs);
  230. };
  231. },
  232. /**
  233. *
  234. * @summary 获取微信用户OpenId
  235. * @param {string} code Code
  236. * @param {*} [options] Override http request option.
  237. * @throws {RequiredError}
  238. */
  239. async apiSysWechatSnsOAuth2Post(code: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultString>>> {
  240. const localVarAxiosArgs = await SysWechatApiAxiosParamCreator(configuration).apiSysWechatSnsOAuth2Post(code, options);
  241. return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
  242. const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
  243. return axios.request(axiosRequestArgs);
  244. };
  245. },
  246. }
  247. };
  248. /**
  249. * SysWechatApi - factory interface
  250. * @export
  251. */
  252. export const SysWechatApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
  253. return {
  254. /**
  255. *
  256. * @summary 生成网页授权Url
  257. * @param {GenAuthUrlInput} [body]
  258. * @param {*} [options] Override http request option.
  259. * @throws {RequiredError}
  260. */
  261. async apiSysWechatGenAuthUrlPost(body?: GenAuthUrlInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultString>> {
  262. return SysWechatApiFp(configuration).apiSysWechatGenAuthUrlPost(body, options).then((request) => request(axios, basePath));
  263. },
  264. /**
  265. *
  266. * @summary 获取配置签名参数(wx.config)
  267. * @param {SignatureInput} [body]
  268. * @param {*} [options] Override http request option.
  269. * @throws {RequiredError}
  270. */
  271. async apiSysWechatGenConfigParaPost(body?: SignatureInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultObject>> {
  272. return SysWechatApiFp(configuration).apiSysWechatGenConfigParaPost(body, options).then((request) => request(axios, basePath));
  273. },
  274. /**
  275. *
  276. * @summary 微信用户登录OpenId
  277. * @param {WechatUserLogin} [body]
  278. * @param {*} [options] Override http request option.
  279. * @throws {RequiredError}
  280. */
  281. async apiSysWechatOpenIdLoginPost(body?: WechatUserLogin, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultObject>> {
  282. return SysWechatApiFp(configuration).apiSysWechatOpenIdLoginPost(body, options).then((request) => request(axios, basePath));
  283. },
  284. /**
  285. *
  286. * @summary 获取微信用户OpenId
  287. * @param {string} code Code
  288. * @param {*} [options] Override http request option.
  289. * @throws {RequiredError}
  290. */
  291. async apiSysWechatSnsOAuth2Post(code: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultString>> {
  292. return SysWechatApiFp(configuration).apiSysWechatSnsOAuth2Post(code, options).then((request) => request(axios, basePath));
  293. },
  294. };
  295. };
  296. /**
  297. * SysWechatApi - object-oriented interface
  298. * @export
  299. * @class SysWechatApi
  300. * @extends {BaseAPI}
  301. */
  302. export class SysWechatApi extends BaseAPI {
  303. /**
  304. *
  305. * @summary 生成网页授权Url
  306. * @param {GenAuthUrlInput} [body]
  307. * @param {*} [options] Override http request option.
  308. * @throws {RequiredError}
  309. * @memberof SysWechatApi
  310. */
  311. public async apiSysWechatGenAuthUrlPost(body?: GenAuthUrlInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultString>> {
  312. return SysWechatApiFp(this.configuration).apiSysWechatGenAuthUrlPost(body, options).then((request) => request(this.axios, this.basePath));
  313. }
  314. /**
  315. *
  316. * @summary 获取配置签名参数(wx.config)
  317. * @param {SignatureInput} [body]
  318. * @param {*} [options] Override http request option.
  319. * @throws {RequiredError}
  320. * @memberof SysWechatApi
  321. */
  322. public async apiSysWechatGenConfigParaPost(body?: SignatureInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultObject>> {
  323. return SysWechatApiFp(this.configuration).apiSysWechatGenConfigParaPost(body, options).then((request) => request(this.axios, this.basePath));
  324. }
  325. /**
  326. *
  327. * @summary 微信用户登录OpenId
  328. * @param {WechatUserLogin} [body]
  329. * @param {*} [options] Override http request option.
  330. * @throws {RequiredError}
  331. * @memberof SysWechatApi
  332. */
  333. public async apiSysWechatOpenIdLoginPost(body?: WechatUserLogin, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultObject>> {
  334. return SysWechatApiFp(this.configuration).apiSysWechatOpenIdLoginPost(body, options).then((request) => request(this.axios, this.basePath));
  335. }
  336. /**
  337. *
  338. * @summary 获取微信用户OpenId
  339. * @param {string} code Code
  340. * @param {*} [options] Override http request option.
  341. * @throws {RequiredError}
  342. * @memberof SysWechatApi
  343. */
  344. public async apiSysWechatSnsOAuth2Post(code: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultString>> {
  345. return SysWechatApiFp(this.configuration).apiSysWechatSnsOAuth2Post(code, options).then((request) => request(this.axios, this.basePath));
  346. }
  347. }