feat: 按文档对接账务管理下页面逻辑与字段
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
/**
|
||||
* 提现管理 API
|
||||
* 对应 OpenAPI: GET /admin/finance/withdraw/page, GET /admin/finance/withdraw/info
|
||||
*/
|
||||
import { get, post } from '@/utils/request';
|
||||
import { USE_MOCK, MOCK_DELAY } from '@/config/mock';
|
||||
import { buildMockWithdrawPage } from '@/config/mock/withdrawList';
|
||||
import { buildMockWithdrawInfo } from '@/config/mock/withdrawInfo';
|
||||
import type { WithdrawQueryParams, WithdrawVO, WithdrawInfoVO, PageData, ApiResult } from './types';
|
||||
|
||||
export type { WithdrawVO, WithdrawInfoVO, WithdrawQueryParams, PageData, ApiResult } from './types';
|
||||
|
||||
const delay = (ms: number) => new Promise<void>((r) => setTimeout(r, ms));
|
||||
|
||||
/** GET /admin/finance/withdraw/page — 提现列表分页 */
|
||||
export async function getWithdrawList(
|
||||
params: WithdrawQueryParams,
|
||||
): Promise<ApiResult<PageData<WithdrawVO>>> {
|
||||
if (USE_MOCK) {
|
||||
await delay(MOCK_DELAY);
|
||||
const page = Number(params.page) || 1;
|
||||
const limit = Number(params.limit) || 10;
|
||||
return {
|
||||
code: 200,
|
||||
msg: 'success',
|
||||
data: buildMockWithdrawPage(page, limit, params),
|
||||
};
|
||||
}
|
||||
return get('/admin/finance/withdraw/page', params as Record<string, any>);
|
||||
}
|
||||
|
||||
/** GET /admin/finance/withdraw/info?id=xxx — 提现详情 */
|
||||
export async function getWithdrawInfo(id: number): Promise<ApiResult<WithdrawInfoVO>> {
|
||||
if (USE_MOCK) {
|
||||
await delay(MOCK_DELAY);
|
||||
return { code: 200, msg: 'success', data: buildMockWithdrawInfo(id) };
|
||||
}
|
||||
return get('/admin/finance/withdraw/info', { id: String(id) });
|
||||
}
|
||||
|
||||
/** 提现审核请求参数 */
|
||||
export interface WithdrawAuditParams {
|
||||
/** 提现ID */
|
||||
id: string;
|
||||
/** 审核结果:1=通过,2=驳回 */
|
||||
audit: string;
|
||||
/** 审核内容 */
|
||||
checkMsg: string;
|
||||
/** 审核图片(逗号拼接的 URL) */
|
||||
checkImg: string;
|
||||
}
|
||||
|
||||
/** POST /admin/finance/withdraw/audit — 审核提现 */
|
||||
export async function postWithdrawAudit(params: WithdrawAuditParams): Promise<ApiResult<null>> {
|
||||
return post('/admin/finance/withdraw/audit', params);
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
/**
|
||||
* 提现管理 — 类型定义
|
||||
* 对应 OpenAPI: GET /admin/finance/withdraw/page
|
||||
*/
|
||||
|
||||
/** 提现列表项(对齐 TournamentFinanceWithdrawVO) */
|
||||
export interface WithdrawVO {
|
||||
/** 提现ID */
|
||||
id: number;
|
||||
/** 申请人昵称 */
|
||||
nickname: string;
|
||||
/** 申请人手机号 */
|
||||
phone: string;
|
||||
/** 申请人真实姓名 */
|
||||
realName: string;
|
||||
/** 提现类型(固定"银行卡") */
|
||||
withdrawType: string;
|
||||
/** 提现金额("0.00"格式) */
|
||||
withdrawAmount: string;
|
||||
/** 到账金额("0.00"格式) */
|
||||
receivedAmount: string;
|
||||
/** 审核状态:0=待审核,1=审核通过,2=审核驳回 */
|
||||
auditStatus: number;
|
||||
/** 到账状态:0=未支付,1=支付成功,2=支付失败 */
|
||||
payStatus: number;
|
||||
/** 流水单号 */
|
||||
serialNumber: string;
|
||||
/** 申请时间 */
|
||||
createDate: string;
|
||||
}
|
||||
|
||||
/** 提现列表查询参数 */
|
||||
export interface WithdrawQueryParams {
|
||||
page?: string;
|
||||
limit?: string;
|
||||
/** 提现申请人昵称 */
|
||||
nickname?: string;
|
||||
/** 提现申请人手机号 */
|
||||
phone?: string;
|
||||
/** 提现申请人真实姓名 */
|
||||
realName?: string;
|
||||
/** 审核状态:0/1/2 */
|
||||
auditStatus?: string;
|
||||
/** 到账状态:0/1/2 */
|
||||
payStatus?: string;
|
||||
}
|
||||
|
||||
export interface PageData<T> {
|
||||
total: number;
|
||||
list: T[];
|
||||
}
|
||||
export interface ApiResult<T> {
|
||||
code: number;
|
||||
msg: string;
|
||||
data: T;
|
||||
}
|
||||
|
||||
/** 提现详情(对齐 TournamentFinanceWithdrawInfoVO) */
|
||||
export interface WithdrawInfoVO {
|
||||
/** 申请人昵称 */
|
||||
nickname: string;
|
||||
/** 申请人手机号 */
|
||||
phone: string;
|
||||
/** 申请人真实姓名 */
|
||||
realName: string;
|
||||
/** 申请时间 */
|
||||
createDate: string;
|
||||
/** 提现类型(固定"银行卡") */
|
||||
withdrawType: string;
|
||||
/** 提现金额("0.00"格式) */
|
||||
withdrawAmount: string;
|
||||
/** 费率 */
|
||||
feeRate: string;
|
||||
/** 手续费 */
|
||||
feeAmount: string;
|
||||
/** 到账金额("0.00"格式) */
|
||||
receivedAmount: string;
|
||||
/** 审核状态:0=待审核,1=审核通过,2=审核驳回 */
|
||||
auditStatus: number;
|
||||
/** 到账状态:0=未支付,1=支付成功,2=支付失败 */
|
||||
payStatus: number;
|
||||
/** 银行卡类型:1=个人 */
|
||||
bankCardType: number;
|
||||
/** 持卡人真实姓名 */
|
||||
cardHolderName: string;
|
||||
/** 银行卡号 */
|
||||
bankCardNumber: string;
|
||||
/** 开户行名称 */
|
||||
bankName: string;
|
||||
/** 支行名称 */
|
||||
branchName: string;
|
||||
/** 支付时间 */
|
||||
payTime: string;
|
||||
/** 订单号 */
|
||||
orderNo: string;
|
||||
/** 审核时间 */
|
||||
auditDate: string;
|
||||
/** 审核人昵称 */
|
||||
auditNickname: string;
|
||||
/** 审核图片 */
|
||||
auditImg: string;
|
||||
/** 审核图片列表 */
|
||||
auditImgList: string[];
|
||||
}
|
||||
Reference in New Issue
Block a user