feat: 添加货币管理功能,更新国际化支持,移除报表相关代码

This commit is contained in:
2026-05-21 16:24:56 +08:00
parent 6ecbaf5fb4
commit 055c613a6d
87 changed files with 1615 additions and 1319 deletions

View File

@@ -0,0 +1,32 @@
import { adminRequest } from "@/lib/admin-http";
import { API_V1_PREFIX } from "./paths";
import type {
AdminCurrencyCreatePayload,
AdminCurrencyDeleteResult,
AdminCurrencyListData,
AdminCurrencyRow,
AdminCurrencyUpdatePayload,
} from "@/types/api/admin-currency";
const A = `${API_V1_PREFIX}/admin`;
export async function getAdminCurrencies(): Promise<AdminCurrencyListData> {
return adminRequest.get<AdminCurrencyListData>(`${A}/currencies`);
}
export async function postAdminCurrency(body: AdminCurrencyCreatePayload): Promise<AdminCurrencyRow> {
return adminRequest.post<AdminCurrencyRow>(`${A}/currencies`, body);
}
export async function putAdminCurrency(
code: string,
body: AdminCurrencyUpdatePayload,
): Promise<AdminCurrencyRow> {
return adminRequest.put<AdminCurrencyRow>(`${A}/currencies/${encodeURIComponent(code)}`, body);
}
export async function deleteAdminCurrency(code: string): Promise<AdminCurrencyDeleteResult> {
return adminRequest.delete<AdminCurrencyDeleteResult>(`${A}/currencies/${encodeURIComponent(code)}`);
}

View File

@@ -22,8 +22,9 @@ export async function getAdminReconcileJobs(params?: {
export async function postAdminReconcileJob(body: {
reconcile_type: string;
period_start?: string | null;
period_end?: string | null;
date_from?: string | null;
date_to?: string | null;
player_id?: number | null;
items?: {
side_a_ref?: string | null;
side_b_ref?: string | null;

View File

@@ -1,44 +0,0 @@
import { adminHttp, adminRequest } from "@/lib/admin-http";
import { withAdminAuthHeader } from "@/lib/admin-auth";
import { withAdminLocaleHeaders } from "@/lib/admin-locale";
import { API_V1_PREFIX } from "./paths";
import type {
AdminReportJobCreateResponse,
AdminReportJobListData,
} from "@/types/api/admin-reports";
const A = `${API_V1_PREFIX}/admin`;
export async function getAdminReportJobs(params?: {
page?: number;
per_page?: number;
}): Promise<AdminReportJobListData> {
return adminRequest.get<AdminReportJobListData>(`${A}/report-jobs`, {
params,
});
}
export async function postAdminReportJob(body: {
report_type: string;
export_format?: "csv" | "xlsx";
parameters?: Record<string, unknown> | null;
filter_json?: Record<string, unknown> | null;
}): Promise<AdminReportJobCreateResponse> {
return adminRequest.post<AdminReportJobCreateResponse>(
`${A}/report-jobs`,
body,
);
}
export async function downloadAdminReportJob(jobId: number): Promise<Blob> {
const res = await adminHttp.request<Blob>(
withAdminAuthHeader(withAdminLocaleHeaders({
url: `${A}/report-jobs/${jobId}/download`,
method: "GET",
responseType: "blob",
})),
);
return res.data;
}

View File

@@ -8,7 +8,6 @@ export {
getAdminTransferOrders,
getAdminWalletTransactions,
} from "@/api/admin-wallet";
export { getAdminReportJobs, postAdminReportJob } from "@/api/admin-reports";
export {
getAdminReconcileJobItems,
getAdminReconcileJobs,