/** * 客户账号管理 API (企业账号) * * @deprecated 此 API 已废弃,请使用统一的 AccountService 代替 * @see AccountService - 统一账号管理接口 (/api/admin/accounts) * * 迁移说明: * - 所有账号类型统一使用 /api/admin/accounts 接口 * - 通过 user_type 参数区分账号类型 (2=平台, 3=代理, 4=企业) * - customer-accounts 已改名为 enterprise(企业账号) * - 详见:docs/迁移指南.md */ import { BaseService } from '../BaseService' import type { BaseResponse } from '@/types/api' import type { CustomerAccountItem, CustomerAccountPageResult, CustomerAccountQueryParams, CreateCustomerAccountParams, UpdateCustomerAccountParams, UpdateCustomerAccountPasswordParams, UpdateCustomerAccountStatusParams } from '@/types/api/customerAccount' export class CustomerAccountService extends BaseService { /** * 查询客户账号列表 */ static getCustomerAccounts( params?: CustomerAccountQueryParams ): Promise> { return this.get>('/api/admin/customer-accounts', params) } /** * 新增代理商账号 */ static createCustomerAccount( data: CreateCustomerAccountParams ): Promise> { return this.post>('/api/admin/customer-accounts', data) } /** * 编辑账号 */ static updateCustomerAccount( id: number, data: UpdateCustomerAccountParams ): Promise> { return this.put>(`/api/admin/customer-accounts/${id}`, data) } /** * 修改账号密码 */ static updateCustomerAccountPassword( id: number, data: UpdateCustomerAccountPasswordParams ): Promise { return this.put(`/api/admin/customer-accounts/${id}/password`, data) } /** * 修改账号状态 */ static updateCustomerAccountStatus( id: number, data: UpdateCustomerAccountStatusParams ): Promise { return this.put(`/api/admin/customer-accounts/${id}/status`, data) } }