/* tslint:disable */ /* eslint-disable */ /** * 统一管理平台API文档 * 包含模块:会员、账号、商品、支付、咨询、营销 * * OpenAPI spec version: 2.0 * * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ import globalAxios, { AxiosPromise, AxiosInstance } from 'axios'; import { Configuration } from '../configuration'; // Some imports not used depending on template conditions // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; import { AuthBody } from '../models'; import { ResponseResult } from '../models'; /** * AuthControllerApi - axios parameter creator * @export */ export const AuthControllerApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * * @summary 登录授权获取AccessToken接口 * @param {string} appid * @param {AuthBody} [body] auth body * @param {*} [options] Override http request option. * @throws {RequiredError} */ authLogin: async (appid: string, body?: AuthBody, options: any = {}): Promise => { // verify required parameter 'appid' is not null or undefined if (appid === null || appid === undefined) { throw new RequiredError('appid', 'Required parameter appid was null or undefined when calling authLogin.'); } const localVarPath = `/auth/login/{appid}` .replace(`{${"appid"}}`, encodeURIComponent(String(appid))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; localVarHeaderParameter['Content-Type'] = 'application/json'; const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.query) { query.set(key, options.query[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @summary 应用账号获取token接口 * @param {AuthBody} [body] auth body * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAccessToken: async (body?: AuthBody, options: any = {}): Promise => { const localVarPath = `/auth/token`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; localVarHeaderParameter['Content-Type'] = 'application/json'; const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.query) { query.set(key, options.query[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @summary 应用AccessToken续期 * @param {string} appid * @param {any} [body] access token string in json object * @param {*} [options] Override http request option. * @throws {RequiredError} */ tokenRenewal: async (appid: string, body?: any, options: any = {}): Promise => { // verify required parameter 'appid' is not null or undefined if (appid === null || appid === undefined) { throw new RequiredError('appid', 'Required parameter appid was null or undefined when calling tokenRenewal.'); } const localVarPath = `/auth/token/renewal/{appid}` .replace(`{${"appid"}}`, encodeURIComponent(String(appid))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; localVarHeaderParameter['Content-Type'] = 'application/json'; const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.query) { query.set(key, options.query[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @summary 应用AccessToken有效性验证 * @param {string} appid * @param {string} [body] access token string * @param {*} [options] Override http request option. * @throws {RequiredError} */ validateToken: async (appid: string, body?: string, options: any = {}): Promise => { // verify required parameter 'appid' is not null or undefined if (appid === null || appid === undefined) { throw new RequiredError('appid', 'Required parameter appid was null or undefined when calling validateToken.'); } const localVarPath = `/auth/validate/{appid}` .replace(`{${"appid"}}`, encodeURIComponent(String(appid))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; localVarHeaderParameter['Content-Type'] = 'application/json'; const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.query) { query.set(key, options.query[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, } }; /** * AuthControllerApi - functional programming interface * @export */ export const AuthControllerApiFp = function (configuration?: Configuration) { return { /** * * @summary 登录授权获取AccessToken接口 * @param {string} appid * @param {AuthBody} [body] auth body * @param {*} [options] Override http request option. * @throws {RequiredError} */ async authLogin(appid: string, body?: AuthBody, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await AuthControllerApiAxiosParamCreator(configuration).authLogin(appid, body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = { ...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url }; return axios.request(axiosRequestArgs); }; }, /** * * @summary 应用账号获取token接口 * @param {AuthBody} [body] auth body * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getAccessToken(body?: AuthBody, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await AuthControllerApiAxiosParamCreator(configuration).getAccessToken(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = { ...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url }; return axios.request(axiosRequestArgs); }; }, /** * * @summary 应用AccessToken续期 * @param {string} appid * @param {any} [body] access token string in json object * @param {*} [options] Override http request option. * @throws {RequiredError} */ async tokenRenewal(appid: string, body?: any, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await AuthControllerApiAxiosParamCreator(configuration).tokenRenewal(appid, body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = { ...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url }; return axios.request(axiosRequestArgs); }; }, /** * * @summary 应用AccessToken有效性验证 * @param {string} appid * @param {string} [body] access token string * @param {*} [options] Override http request option. * @throws {RequiredError} */ async validateToken(appid: string, body?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await AuthControllerApiAxiosParamCreator(configuration).validateToken(appid, body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = { ...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url }; return axios.request(axiosRequestArgs); }; }, } }; /** * AuthControllerApi - factory interface * @export */ export const AuthControllerApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { return { /** * * @summary 登录授权获取AccessToken接口 * @param {string} appid * @param {AuthBody} [body] auth body * @param {*} [options] Override http request option. * @throws {RequiredError} */ authLogin(appid: string, body?: AuthBody, options?: any): AxiosPromise { return AuthControllerApiFp(configuration).authLogin(appid, body, options).then((request) => request(axios, basePath)); }, /** * * @summary 应用账号获取token接口 * @param {AuthBody} [body] auth body * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAccessToken(body?: AuthBody, options?: any): AxiosPromise { return AuthControllerApiFp(configuration).getAccessToken(body, options).then((request) => request(axios, basePath)); }, /** * * @summary 应用AccessToken续期 * @param {string} appid * @param {any} [body] access token string in json object * @param {*} [options] Override http request option. * @throws {RequiredError} */ tokenRenewal(appid: string, body?: any, options?: any): AxiosPromise { return AuthControllerApiFp(configuration).tokenRenewal(appid, body, options).then((request) => request(axios, basePath)); }, /** * * @summary 应用AccessToken有效性验证 * @param {string} appid * @param {string} [body] access token string * @param {*} [options] Override http request option. * @throws {RequiredError} */ validateToken(appid: string, body?: string, options?: any): AxiosPromise { return AuthControllerApiFp(configuration).validateToken(appid, body, options).then((request) => request(axios, basePath)); }, }; }; /** * AuthControllerApi - object-oriented interface * @export * @class AuthControllerApi * @extends {BaseAPI} */ export class AuthControllerApi extends BaseAPI { /** * * @summary 登录授权获取AccessToken接口 * @param {string} appid * @param {AuthBody} [body] auth body * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AuthControllerApi */ public authLogin(appid: string, body?: AuthBody, options?: any) { return AuthControllerApiFp(this.configuration).authLogin(appid, body, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary 应用账号获取token接口 * @param {AuthBody} [body] auth body * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AuthControllerApi */ public getAccessToken(body?: AuthBody, options?: any) { return AuthControllerApiFp(this.configuration).getAccessToken(body, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary 应用AccessToken续期 * @param {string} appid * @param {any} [body] access token string in json object * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AuthControllerApi */ public tokenRenewal(appid: string, body?: any, options?: any) { return AuthControllerApiFp(this.configuration).tokenRenewal(appid, body, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary 应用AccessToken有效性验证 * @param {string} appid * @param {string} [body] access token string * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AuthControllerApi */ public validateToken(appid: string, body?: string, options?: any) { return AuthControllerApiFp(this.configuration).validateToken(appid, body, options).then((request) => request(this.axios, this.basePath)); } }