/* 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 { App } from '../models'; import { ResponseResult } from '../models'; /** * AppControllerApi - axios parameter creator * @export */ export const AppControllerApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ allAppNameAndList: async (options: any = {}): Promise => { const localVarPath = `/app/nameAndIdList`; // 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; 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}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @param {App} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ appAdd: async (body?: App, options: any = {}): Promise => { const localVarPath = `/app/add`; // 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, }; }, /** * * @param {string} appid * @param {string} action * @param {App} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ appUpdate: async (appid: string, action: string, body?: App, 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 appUpdate.'); } // verify required parameter 'action' is not null or undefined if (action === null || action === undefined) { throw new RequiredError('action','Required parameter action was null or undefined when calling appUpdate.'); } const localVarPath = `/app/{appid}/{action}` .replace(`{${"appid"}}`, encodeURIComponent(String(appid))) .replace(`{${"action"}}`, encodeURIComponent(String(action))); // 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, }; }, /** * * @param {string} appid * @param {*} [options] Override http request option. * @throws {RequiredError} */ getApp: async (appid: 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 getApp.'); } const localVarPath = `/app/get/{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; 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}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * * @param {number} page * @param {number} size * @param {App} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAppList: async (page: number, size: number, body?: App, options: any = {}): Promise => { // verify required parameter 'page' is not null or undefined if (page === null || page === undefined) { throw new RequiredError('page','Required parameter page was null or undefined when calling getAppList.'); } // verify required parameter 'size' is not null or undefined if (size === null || size === undefined) { throw new RequiredError('size','Required parameter size was null or undefined when calling getAppList.'); } const localVarPath = `/app/list/{page}/{size}` .replace(`{${"page"}}`, encodeURIComponent(String(page))) .replace(`{${"size"}}`, encodeURIComponent(String(size))); // 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, }; }, } }; /** * AppControllerApi - functional programming interface * @export */ export const AppControllerApiFp = function(configuration?: Configuration) { return { /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ async allAppNameAndList(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await AppControllerApiAxiosParamCreator(configuration).allAppNameAndList(options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @param {App} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async appAdd(body?: App, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await AppControllerApiAxiosParamCreator(configuration).appAdd(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @param {string} appid * @param {string} action * @param {App} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async appUpdate(appid: string, action: string, body?: App, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await AppControllerApiAxiosParamCreator(configuration).appUpdate(appid, action, body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @param {string} appid * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getApp(appid: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await AppControllerApiAxiosParamCreator(configuration).getApp(appid, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @param {number} page * @param {number} size * @param {App} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getAppList(page: number, size: number, body?: App, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await AppControllerApiAxiosParamCreator(configuration).getAppList(page, size, body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, } }; /** * AppControllerApi - factory interface * @export */ export const AppControllerApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { return { /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ allAppNameAndList(options?: any): AxiosPromise { return AppControllerApiFp(configuration).allAppNameAndList(options).then((request) => request(axios, basePath)); }, /** * * @param {App} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ appAdd(body?: App, options?: any): AxiosPromise { return AppControllerApiFp(configuration).appAdd(body, options).then((request) => request(axios, basePath)); }, /** * * @param {string} appid * @param {string} action * @param {App} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ appUpdate(appid: string, action: string, body?: App, options?: any): AxiosPromise { return AppControllerApiFp(configuration).appUpdate(appid, action, body, options).then((request) => request(axios, basePath)); }, /** * * @param {string} appid * @param {*} [options] Override http request option. * @throws {RequiredError} */ getApp(appid: string, options?: any): AxiosPromise { return AppControllerApiFp(configuration).getApp(appid, options).then((request) => request(axios, basePath)); }, /** * * @param {number} page * @param {number} size * @param {App} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAppList(page: number, size: number, body?: App, options?: any): AxiosPromise { return AppControllerApiFp(configuration).getAppList(page, size, body, options).then((request) => request(axios, basePath)); }, }; }; /** * AppControllerApi - object-oriented interface * @export * @class AppControllerApi * @extends {BaseAPI} */ export class AppControllerApi extends BaseAPI { /** * * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AppControllerApi */ public allAppNameAndList(options?: any) { return AppControllerApiFp(this.configuration).allAppNameAndList(options).then((request) => request(this.axios, this.basePath)); } /** * * @param {App} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AppControllerApi */ public appAdd(body?: App, options?: any) { return AppControllerApiFp(this.configuration).appAdd(body, options).then((request) => request(this.axios, this.basePath)); } /** * * @param {string} appid * @param {string} action * @param {App} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AppControllerApi */ public appUpdate(appid: string, action: string, body?: App, options?: any) { return AppControllerApiFp(this.configuration).appUpdate(appid, action, body, options).then((request) => request(this.axios, this.basePath)); } /** * * @param {string} appid * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AppControllerApi */ public getApp(appid: string, options?: any) { return AppControllerApiFp(this.configuration).getApp(appid, options).then((request) => request(this.axios, this.basePath)); } /** * * @param {number} page * @param {number} size * @param {App} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AppControllerApi */ public getAppList(page: number, size: number, body?: App, options?: any) { return AppControllerApiFp(this.configuration).getAppList(page, size, body, options).then((request) => request(this.axios, this.basePath)); } }