/* 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 { ResponseResultSetAddress } from '../models'; /** * AddressControllerApi - axios parameter creator * @export */ export const AddressControllerApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * * @summary 根据上一级城市编码获取下属所有城市的信息 * @param {number} parentId * @param {*} [options] Override http request option. * @throws {RequiredError} */ getChild: async (parentId: number, options: any = {}): Promise => { // verify required parameter 'parentId' is not null or undefined if (parentId === null || parentId === undefined) { throw new RequiredError('parentId', 'Required parameter parentId was null or undefined when calling getChild.'); } const localVarPath = `/address/child/{parentId}` .replace(`{${"parentId"}}`, encodeURIComponent(String(parentId))); // 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 {*} [options] Override http request option. * @throws {RequiredError} */ listAllAddress: async (options: any = {}): Promise => { const localVarPath = `/address/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, }; }, } }; /** * AddressControllerApi - functional programming interface * @export */ export const AddressControllerApiFp = function (configuration?: Configuration) { return { /** * * @summary 根据上一级城市编码获取下属所有城市的信息 * @param {number} parentId * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getChild(parentId: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await AddressControllerApiAxiosParamCreator(configuration).getChild(parentId, 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 listAllAddress(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await AddressControllerApiAxiosParamCreator(configuration).listAllAddress(options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = { ...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url }; return axios.request(axiosRequestArgs); }; }, } }; /** * AddressControllerApi - factory interface * @export */ export const AddressControllerApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { return { /** * * @summary 根据上一级城市编码获取下属所有城市的信息 * @param {number} parentId * @param {*} [options] Override http request option. * @throws {RequiredError} */ getChild(parentId: number, options?: any): AxiosPromise { return AddressControllerApiFp(configuration).getChild(parentId, options).then((request) => request(axios, basePath)); }, /** * * @param {*} [options] Override http request option. * @throws {RequiredError} */ listAllAddress(options?: any): AxiosPromise { return AddressControllerApiFp(configuration).listAllAddress(options).then((request) => request(axios, basePath)); }, }; }; /** * AddressControllerApi - object-oriented interface * @export * @class AddressControllerApi * @extends {BaseAPI} */ export class AddressControllerApi extends BaseAPI { /** * * @summary 根据上一级城市编码获取下属所有城市的信息 * @param {number} parentId * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AddressControllerApi */ public getChild(parentId: number, options?: any) { return AddressControllerApiFp(this.configuration).getChild(parentId, options).then((request) => request(this.axios, this.basePath)); } /** * * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AddressControllerApi */ public listAllAddress(options?: any) { return AddressControllerApiFp(this.configuration).listAllAddress(options).then((request) => request(this.axios, this.basePath)); } }