/* 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 { Account } from '../models'; import { AuthBody } from '../models'; import { ResponseResult } from '../models'; import { Role } from '../models'; /** * AccountControllerApi - axios parameter creator * @export */ export const AccountControllerApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * * @param {Account} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ addAppAccount: async (body?: Account, options: any = {}): Promise => { const localVarPath = `/account/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} account * @param {string} appid * @param {Array<Role>} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ bindRoles: async (account: string, appid: string, body?: Array, options: any = {}): Promise => { // verify required parameter 'account' is not null or undefined if (account === null || account === undefined) { throw new RequiredError('account', 'Required parameter account was null or undefined when calling bindRoles.'); } // 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 bindRoles.'); } const localVarPath = `/account/role/bind/{appid}/{account}` .replace(`{${"account"}}`, encodeURIComponent(String(account))) .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, }; }, /** * * @param {AuthBody} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ createAccountByMobile: async (body?: AuthBody, options: any = {}): Promise => { const localVarPath = `/account/mobile/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 {Account} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteAccount: async (body?: Account, options: any = {}): Promise => { const localVarPath = `/account/delete`; // 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 {Account} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAccountInfoByAccount: async (body?: Account, options: any = {}): Promise => { const localVarPath = `/account/get`; // 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 会员列表 * @param {number} page * @param {number} rows * @param {Account} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAppAccountList: async (page: number, rows: number, body?: Account, 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 getAppAccountList.'); } // 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 getAppAccountList.'); } const localVarPath = `/account/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, }; }, /** * * @summary 发送短信登录验证码 * @param {string} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ sendLoginSmsCode: async (body?: string, options: any = {}): Promise => { const localVarPath = `/account/sendLoginSms`; // 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 {Account} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateAppAccount: async (body?: Account, options: any = {}): Promise => { const localVarPath = `/account/update`; // 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, }; }, } }; /** * AccountControllerApi - functional programming interface * @export */ export const AccountControllerApiFp = function (configuration?: Configuration) { return { /** * * @param {Account} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async addAppAccount(body?: Account, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await AccountControllerApiAxiosParamCreator(configuration).addAppAccount(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = { ...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url }; return axios.request(axiosRequestArgs); }; }, /** * * @param {string} account * @param {string} appid * @param {Array<Role>} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async bindRoles(account: string, appid: string, body?: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await AccountControllerApiAxiosParamCreator(configuration).bindRoles(account, appid, body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = { ...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url }; return axios.request(axiosRequestArgs); }; }, /** * * @param {AuthBody} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createAccountByMobile(body?: AuthBody, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await AccountControllerApiAxiosParamCreator(configuration).createAccountByMobile(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = { ...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url }; return axios.request(axiosRequestArgs); }; }, /** * * @param {Account} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async deleteAccount(body?: Account, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await AccountControllerApiAxiosParamCreator(configuration).deleteAccount(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = { ...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url }; return axios.request(axiosRequestArgs); }; }, /** * * @param {Account} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getAccountInfoByAccount(body?: Account, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await AccountControllerApiAxiosParamCreator(configuration).getAccountInfoByAccount(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = { ...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url }; return axios.request(axiosRequestArgs); }; }, /** * 分页获取指定应用的会员账号信息 * @summary 会员列表 * @param {number} page * @param {number} rows * @param {Account} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getAppAccountList(page: number, rows: number, body?: Account, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await AccountControllerApiAxiosParamCreator(configuration).getAppAccountList(page, rows, body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = { ...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url }; return axios.request(axiosRequestArgs); }; }, /** * * @summary 发送短信登录验证码 * @param {string} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async sendLoginSmsCode(body?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await AccountControllerApiAxiosParamCreator(configuration).sendLoginSmsCode(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = { ...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url }; return axios.request(axiosRequestArgs); }; }, /** * * @param {Account} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateAppAccount(body?: Account, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await AccountControllerApiAxiosParamCreator(configuration).updateAppAccount(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs = { ...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url }; return axios.request(axiosRequestArgs); }; }, } }; /** * AccountControllerApi - factory interface * @export */ export const AccountControllerApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { return { /** * * @param {Account} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ addAppAccount(body?: Account, options?: any): AxiosPromise { return AccountControllerApiFp(configuration).addAppAccount(body, options).then((request) => request(axios, basePath)); }, /** * * @param {string} account * @param {string} appid * @param {Array<Role>} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ bindRoles(account: string, appid: string, body?: Array, options?: any): AxiosPromise { return AccountControllerApiFp(configuration).bindRoles(account, appid, body, options).then((request) => request(axios, basePath)); }, /** * * @param {AuthBody} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ createAccountByMobile(body?: AuthBody, options?: any): AxiosPromise { return AccountControllerApiFp(configuration).createAccountByMobile(body, options).then((request) => request(axios, basePath)); }, /** * * @param {Account} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteAccount(body?: Account, options?: any): AxiosPromise { return AccountControllerApiFp(configuration).deleteAccount(body, options).then((request) => request(axios, basePath)); }, /** * * @param {Account} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAccountInfoByAccount(body?: Account, options?: any): AxiosPromise { return AccountControllerApiFp(configuration).getAccountInfoByAccount(body, options).then((request) => request(axios, basePath)); }, /** * 分页获取指定应用的会员账号信息 * @summary 会员列表 * @param {number} page * @param {number} rows * @param {Account} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAppAccountList(page: number, rows: number, body?: Account, options?: any): AxiosPromise { return AccountControllerApiFp(configuration).getAppAccountList(page, rows, body, options).then((request) => request(axios, basePath)); }, /** * * @summary 发送短信登录验证码 * @param {string} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ sendLoginSmsCode(body?: string, options?: any): AxiosPromise { return AccountControllerApiFp(configuration).sendLoginSmsCode(body, options).then((request) => request(axios, basePath)); }, /** * * @param {Account} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateAppAccount(body?: Account, options?: any): AxiosPromise { return AccountControllerApiFp(configuration).updateAppAccount(body, options).then((request) => request(axios, basePath)); }, }; }; /** * AccountControllerApi - object-oriented interface * @export * @class AccountControllerApi * @extends {BaseAPI} */ export class AccountControllerApi extends BaseAPI { /** * * @param {Account} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AccountControllerApi */ public addAppAccount(body?: Account, options?: any) { return AccountControllerApiFp(this.configuration).addAppAccount(body, options).then((request) => request(this.axios, this.basePath)); } /** * * @param {string} account * @param {string} appid * @param {Array<Role>} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AccountControllerApi */ public bindRoles(account: string, appid: string, body?: Array, options?: any) { return AccountControllerApiFp(this.configuration).bindRoles(account, appid, body, options).then((request) => request(this.axios, this.basePath)); } /** * * @param {AuthBody} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AccountControllerApi */ public createAccountByMobile(body?: AuthBody, options?: any) { return AccountControllerApiFp(this.configuration).createAccountByMobile(body, options).then((request) => request(this.axios, this.basePath)); } /** * * @param {Account} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AccountControllerApi */ public deleteAccount(body?: Account, options?: any) { return AccountControllerApiFp(this.configuration).deleteAccount(body, options).then((request) => request(this.axios, this.basePath)); } /** * * @param {Account} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AccountControllerApi */ public getAccountInfoByAccount(body?: Account, options?: any) { return AccountControllerApiFp(this.configuration).getAccountInfoByAccount(body, options).then((request) => request(this.axios, this.basePath)); } /** * 分页获取指定应用的会员账号信息 * @summary 会员列表 * @param {number} page * @param {number} rows * @param {Account} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AccountControllerApi */ public getAppAccountList(page: number, rows: number, body?: Account, options?: any) { return AccountControllerApiFp(this.configuration).getAppAccountList(page, rows, body, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary 发送短信登录验证码 * @param {string} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AccountControllerApi */ public sendLoginSmsCode(body?: string, options?: any) { return AccountControllerApiFp(this.configuration).sendLoginSmsCode(body, options).then((request) => request(this.axios, this.basePath)); } /** * * @param {Account} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof AccountControllerApi */ public updateAppAccount(body?: Account, options?: any) { return AccountControllerApiFp(this.configuration).updateAppAccount(body, options).then((request) => request(this.axios, this.basePath)); } }