fix: 对接提现申请与用户钱包,支付流水页面,对接角色权限页面
This commit is contained in:
@@ -5,16 +5,27 @@
|
||||
import { get } from '@/utils/request';
|
||||
import { USE_MOCK, MOCK_DELAY } from '@/config/mock';
|
||||
import { buildMockPaymentFlowPage } from '@/config/mock/paymentFlow';
|
||||
import type { PaymentFlowQueryParams, PaymentFlowVO, PageData, ApiResult } from './types';
|
||||
import type {
|
||||
PaymentFlowQueryParams,
|
||||
PaymentFlowVO,
|
||||
PaymentFlowPageData,
|
||||
ApiResult,
|
||||
} from './types';
|
||||
|
||||
export type { PaymentFlowVO, PaymentFlowQueryParams, PageData, ApiResult } from './types';
|
||||
export type {
|
||||
PaymentFlowVO,
|
||||
PaymentFlowQueryParams,
|
||||
PaymentFlowPageData,
|
||||
PaymentFlowExData,
|
||||
ApiResult,
|
||||
} from './types';
|
||||
|
||||
const delay = (ms: number) => new Promise<void>((r) => setTimeout(r, ms));
|
||||
|
||||
/** GET /admin/finance/paymentFlow/page — 支付流水分页 */
|
||||
export async function getPaymentFlowList(
|
||||
params: PaymentFlowQueryParams,
|
||||
): Promise<ApiResult<PageData<PaymentFlowVO>>> {
|
||||
): Promise<ApiResult<PaymentFlowPageData>> {
|
||||
if (USE_MOCK) {
|
||||
await delay(MOCK_DELAY);
|
||||
const page = Number(params.page) || 1;
|
||||
|
||||
@@ -41,6 +41,22 @@ export interface PageData<T> {
|
||||
total: number;
|
||||
list: T[];
|
||||
}
|
||||
|
||||
/** 支付流水分页扩展汇总(与 total 同级) */
|
||||
export interface PaymentFlowExData {
|
||||
/** 总支付金额 */
|
||||
totalAmount: string;
|
||||
/** 总退款金额 */
|
||||
totalRefundAmount: string;
|
||||
}
|
||||
|
||||
/** 支付流水分页响应 */
|
||||
export interface PaymentFlowPageData {
|
||||
total: number;
|
||||
list: PaymentFlowVO[];
|
||||
exData: PaymentFlowExData;
|
||||
}
|
||||
|
||||
export interface ApiResult<T> {
|
||||
code: number;
|
||||
msg: string;
|
||||
|
||||
@@ -41,6 +41,19 @@ export interface RoleUsageUserQueryParams {
|
||||
roleId?: string;
|
||||
}
|
||||
|
||||
/** 保存角色 — POST /admin/sys/role/save */
|
||||
export interface RoleSaveParams {
|
||||
name: string;
|
||||
menuIds: string[];
|
||||
}
|
||||
|
||||
/** 更新角色 — POST /admin/sys/role/update */
|
||||
export interface RoleUpdateParams {
|
||||
id: string;
|
||||
name: string;
|
||||
menuIds: string[];
|
||||
}
|
||||
|
||||
export interface PageData<T> {
|
||||
total: number;
|
||||
list: T[];
|
||||
|
||||
@@ -28,7 +28,7 @@ export type {
|
||||
|
||||
const delay = (ms: number) => new Promise<void>((r) => setTimeout(r, ms));
|
||||
|
||||
/** GET /sys/user/page — 用户分页 */
|
||||
/** GET /admin/sys/user/page — 用户分页 */
|
||||
export async function getUserList(
|
||||
params: UserListQueryParams,
|
||||
): Promise<ApiResult<PageData<TournamentAdminUserVO>>> {
|
||||
@@ -38,7 +38,7 @@ export async function getUserList(
|
||||
const limit = Number(params.limit) || 10;
|
||||
return { code: 200, msg: 'success', data: buildMockUserListPage(page, limit) };
|
||||
}
|
||||
return get('/sys/user/page', params as Record<string, any>);
|
||||
return get('/admin/sys/user/page', params as Record<string, any>);
|
||||
}
|
||||
|
||||
/** POST /sys/user/save — 新增用户 */
|
||||
|
||||
Reference in New Issue
Block a user