fix: 新增代理系列授权-建议售价使用套餐
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m38s

This commit is contained in:
sexygoat
2026-06-12 10:41:37 +08:00
parent d23e896f97
commit e04a283319
98 changed files with 4279 additions and 6170 deletions

View File

@@ -17,6 +17,7 @@ import type {
SuspendResumeRecord,
CardOrder,
BaseResponse,
PaginationParams,
PaginationResponse,
ListResponse,
GatewayRealnameLinkResponse,
@@ -24,12 +25,36 @@ import type {
ImportIotCardResponse,
IotCardImportTask,
IotCardImportTaskDetail,
IotCardImportTaskQueryParams,
StandaloneCardQueryParams,
StandaloneIotCard,
AllocateStandaloneCardsRequest,
AllocateStandaloneCardsResponse,
RecallStandaloneCardsRequest,
AssetAllocationRecordQueryParams,
AssetAllocationRecord,
AssetAllocationRecordDetail,
BatchSetCardSeriesBindingRequest,
BatchSetCardSeriesBindingResponse
} from '@/types/api'
type ApiQueryParams = PaginationParams & Record<string, unknown>
interface ImportFailureRecord {
line?: number
row?: number
iccid?: string
reason: string
}
interface CardChangeNotice {
id: string | number
iccids: string[]
reason: string
createTime?: string
operatorName?: string
}
export class CardService extends BaseService {
// ========== 号卡商品管理 ==========
@@ -37,7 +62,7 @@ export class CardService extends BaseService {
* 获取号卡商品列表
* @param params 查询参数
*/
static getSimCardProducts(params?: any): Promise<PaginationResponse<SimCardProduct>> {
static getSimCardProducts(params?: ApiQueryParams): Promise<PaginationResponse<SimCardProduct>> {
return this.getPage<SimCardProduct>('/api/simcard-products', params)
}
@@ -95,15 +120,6 @@ export class CardService extends BaseService {
return this.getOne<Card>(`/api/cards/iccid/${iccid}`)
}
/**
* 通过ICCID查询单卡详情旧接口已废弃
* @deprecated 使用 AssetService.resolveAsset 替代
* @param iccid ICCID
*/
static getIotCardDetailByIccid(iccid: string): Promise<BaseResponse<any>> {
return this.getOne<any>(`/api/admin/iot-cards/by-iccid/${iccid}`)
}
/**
* 网卡操作(充值、停复机、增减流量等)
* @param params 操作参数
@@ -214,7 +230,7 @@ export class CardService extends BaseService {
* 获取导入批次列表
* @param params 查询参数
*/
static getImportBatches(params?: any): Promise<PaginationResponse<CardImportBatch>> {
static getImportBatches(params?: ApiQueryParams): Promise<PaginationResponse<CardImportBatch>> {
return this.getPage<CardImportBatch>('/api/cards/import-batches', params)
}
@@ -223,7 +239,7 @@ export class CardService extends BaseService {
* @param file Excel文件
* @param params 额外参数
*/
static importCards(file: File, params?: Record<string, any>): Promise<BaseResponse> {
static importCards(file: File, params?: Record<string, unknown>): Promise<BaseResponse> {
return this.upload('/api/cards/import', file, params)
}
@@ -231,15 +247,17 @@ export class CardService extends BaseService {
* 获取导入失败记录
* @param batchId 批次ID
*/
static getImportFailures(batchId: string | number): Promise<ListResponse<any>> {
return this.getList(`/api/cards/import-batches/${batchId}/failures`)
static getImportFailures(batchId: string | number): Promise<ListResponse<ImportFailureRecord>> {
return this.getList<ImportFailureRecord>(`/api/cards/import-batches/${batchId}/failures`)
}
/**
* 批量充值记录列表
* @param params 查询参数
*/
static getBatchRechargeRecords(params?: any): Promise<PaginationResponse<BatchRechargeRecord>> {
static getBatchRechargeRecords(
params?: ApiQueryParams
): Promise<PaginationResponse<BatchRechargeRecord>> {
return this.getPage<BatchRechargeRecord>('/api/cards/batch-recharge-records', params)
}
@@ -258,7 +276,7 @@ export class CardService extends BaseService {
* @param params 查询参数
*/
static getCardChangeApplications(
params?: any
params?: ApiQueryParams
): Promise<PaginationResponse<CardChangeApplication>> {
return this.getPage<CardChangeApplication>('/api/card-change-applications', params)
}
@@ -284,8 +302,10 @@ export class CardService extends BaseService {
* 获取换卡通知记录
* @param params 查询参数
*/
static getCardChangeNotices(params?: any): Promise<PaginationResponse<any>> {
return this.getPage('/api/card-change-notices', params)
static getCardChangeNotices(
params?: ApiQueryParams
): Promise<PaginationResponse<CardChangeNotice>> {
return this.getPage<CardChangeNotice>('/api/card-change-notices', params)
}
// ========== ICCID批量导入相关 ==========
@@ -302,8 +322,10 @@ export class CardService extends BaseService {
* 获取导入任务列表
* @param params 查询参数
*/
static getIotCardImportTasks(params?: any): Promise<PaginationResponse<IotCardImportTask>> {
return this.getPage('/api/admin/iot-cards/import-tasks', params)
static getIotCardImportTasks(
params?: IotCardImportTaskQueryParams
): Promise<PaginationResponse<IotCardImportTask>> {
return this.getPage<IotCardImportTask>('/api/admin/iot-cards/import-tasks', params)
}
/**
@@ -330,16 +352,26 @@ export class CardService extends BaseService {
* 批量分配单卡
* @param data 分配参数
*/
static allocateStandaloneCards(data: any): Promise<BaseResponse<any>> {
return this.post('/api/admin/iot-cards/standalone/allocate', data)
static allocateStandaloneCards(
data: Partial<AllocateStandaloneCardsRequest>
): Promise<BaseResponse<AllocateStandaloneCardsResponse>> {
return this.post<BaseResponse<AllocateStandaloneCardsResponse>>(
'/api/admin/iot-cards/standalone/allocate',
data
)
}
/**
* 批量回收单卡
* @param data 回收参数
*/
static recallStandaloneCards(data: any): Promise<BaseResponse<any>> {
return this.post('/api/admin/iot-cards/standalone/recall', data)
static recallStandaloneCards(
data: Partial<RecallStandaloneCardsRequest>
): Promise<BaseResponse<AllocateStandaloneCardsResponse>> {
return this.post<BaseResponse<AllocateStandaloneCardsResponse>>(
'/api/admin/iot-cards/standalone/recall',
data
)
}
// ========== 资产分配记录相关 ==========
@@ -348,16 +380,20 @@ export class CardService extends BaseService {
* 获取资产分配记录列表
* @param params 查询参数
*/
static getAssetAllocationRecords(params?: any): Promise<PaginationResponse<any>> {
return this.getPage('/api/admin/asset-allocation-records', params)
static getAssetAllocationRecords(
params?: AssetAllocationRecordQueryParams
): Promise<PaginationResponse<AssetAllocationRecord>> {
return this.getPage<AssetAllocationRecord>('/api/admin/asset-allocation-records', params)
}
/**
* 获取资产分配记录详情
* @param id 记录ID
*/
static getAssetAllocationRecordDetail(id: number): Promise<BaseResponse<any>> {
return this.getOne(`/api/admin/asset-allocation-records/${id}`)
static getAssetAllocationRecordDetail(
id: number
): Promise<BaseResponse<AssetAllocationRecordDetail>> {
return this.getOne<AssetAllocationRecordDetail>(`/api/admin/asset-allocation-records/${id}`)
}
// ========== 批量设置卡的套餐系列绑定相关 ==========