/* 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 { ResponseResult } from '../models'; import { Section } from '../models'; /** * SectionControllerApi - axios parameter creator * @export */ export const SectionControllerApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * * @param {Section} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ addSection: async (body?: Section, options: any = {}): Promise => { const localVarPath = `/section/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 {*} [options] Override http request option. * @throws {RequiredError} */ getAllIdAndNameList: async (options: any = {}): Promise => { const localVarPath = `/section/all`; // 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} rows * @param {Section} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getSectionList: async (page: number, rows: number, body?: Section, 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 getSectionList.'); } // verify required parameter 'rows' is not null or undefined if (rows === null || rows === undefined) { throw new RequiredError('rows','Required parameter rows was null or undefined when calling getSectionList.'); } const localVarPath = `/section/list/{page}/{rows}` .replace(`{${"page"}}`, encodeURIComponent(String(page))) .replace(`{${"rows"}}`, encodeURIComponent(String(rows))); // 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 {Section} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateSection: async (body?: Section, options: any = {}): Promise => { const localVarPath = `/section/merge`; // 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, }; }, } }; /** * SectionControllerApi - functional programming interface * @export */ export const SectionControllerApiFp = function(configuration?: Configuration) { return { /** * * @param {Section} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async addSection(body?: Section, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await SectionControllerApiAxiosParamCreator(configuration).addSection(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getAllIdAndNameList(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await SectionControllerApiAxiosParamCreator(configuration).getAllIdAndNameList(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} rows * @param {Section} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getSectionList(page: number, rows: number, body?: Section, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await SectionControllerApiAxiosParamCreator(configuration).getSectionList(page, rows, body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * * @param {Section} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateSection(body?: Section, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await SectionControllerApiAxiosParamCreator(configuration).updateSection(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, } }; /** * SectionControllerApi - factory interface * @export */ export const SectionControllerApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { return { /** * * @param {Section} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ addSection(body?: Section, options?: any): AxiosPromise { return SectionControllerApiFp(configuration).addSection(body, options).then((request) => request(axios, basePath)); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAllIdAndNameList(options?: any): AxiosPromise { return SectionControllerApiFp(configuration).getAllIdAndNameList(options).then((request) => request(axios, basePath)); }, /** * * @param {number} page * @param {number} rows * @param {Section} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getSectionList(page: number, rows: number, body?: Section, options?: any): AxiosPromise { return SectionControllerApiFp(configuration).getSectionList(page, rows, body, options).then((request) => request(axios, basePath)); }, /** * * @param {Section} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateSection(body?: Section, options?: any): AxiosPromise { return SectionControllerApiFp(configuration).updateSection(body, options).then((request) => request(axios, basePath)); }, }; }; /** * SectionControllerApi - object-oriented interface * @export * @class SectionControllerApi * @extends {BaseAPI} */ export class SectionControllerApi extends BaseAPI { /** * * @param {Section} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SectionControllerApi */ public addSection(body?: Section, options?: any) { return SectionControllerApiFp(this.configuration).addSection(body, options).then((request) => request(this.axios, this.basePath)); } /** * * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SectionControllerApi */ public getAllIdAndNameList(options?: any) { return SectionControllerApiFp(this.configuration).getAllIdAndNameList(options).then((request) => request(this.axios, this.basePath)); } /** * * @param {number} page * @param {number} rows * @param {Section} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SectionControllerApi */ public getSectionList(page: number, rows: number, body?: Section, options?: any) { return SectionControllerApiFp(this.configuration).getSectionList(page, rows, body, options).then((request) => request(this.axios, this.basePath)); } /** * * @param {Section} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SectionControllerApi */ public updateSection(body?: Section, options?: any) { return SectionControllerApiFp(this.configuration).updateSection(body, options).then((request) => request(this.axios, this.basePath)); } }