feat: 添加日期处理库和日历选择器,更新管理员抽奖模块
This commit is contained in:
40
src/api/admin-draws.ts
Normal file
40
src/api/admin-draws.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import { adminRequest } from "@/lib/admin-http";
|
||||
|
||||
import { API_V1_PREFIX } from "./paths";
|
||||
|
||||
import type {
|
||||
AdminDrawBatchesData,
|
||||
AdminDrawListData,
|
||||
AdminDrawPublishResponse,
|
||||
AdminDrawShowData,
|
||||
} from "@/types/api/admin-draws";
|
||||
|
||||
const A = `${API_V1_PREFIX}/admin`;
|
||||
|
||||
export type AdminDrawListQuery = {
|
||||
page?: number;
|
||||
per_page?: number;
|
||||
draw_no?: string;
|
||||
status?: string;
|
||||
};
|
||||
|
||||
export async function getAdminDraws(q: AdminDrawListQuery = {}): Promise<AdminDrawListData> {
|
||||
return adminRequest.get<AdminDrawListData>(`${A}/draws`, { params: q });
|
||||
}
|
||||
|
||||
export async function getAdminDraw(drawId: number): Promise<AdminDrawShowData> {
|
||||
return adminRequest.get<AdminDrawShowData>(`${A}/draws/${drawId}`);
|
||||
}
|
||||
|
||||
export async function getAdminDrawResultBatches(drawId: number): Promise<AdminDrawBatchesData> {
|
||||
return adminRequest.get<AdminDrawBatchesData>(`${A}/draws/${drawId}/result-batches`);
|
||||
}
|
||||
|
||||
export async function postAdminPublishResultBatch(
|
||||
drawId: number,
|
||||
batchId: number,
|
||||
): Promise<AdminDrawPublishResponse> {
|
||||
return adminRequest.post<AdminDrawPublishResponse>(
|
||||
`${A}/draws/${drawId}/result-batches/${batchId}/publish`,
|
||||
);
|
||||
}
|
||||
@@ -6,6 +6,12 @@ export {
|
||||
getAdminTransferOrders,
|
||||
getAdminWalletTransactions,
|
||||
} from "@/api/admin-wallet";
|
||||
export {
|
||||
getAdminDraw,
|
||||
getAdminDrawResultBatches,
|
||||
getAdminDraws,
|
||||
postAdminPublishResultBatch,
|
||||
} from "@/api/admin-draws";
|
||||
export type {
|
||||
AdminAuthCaptchaResponse,
|
||||
AdminAuthLoginRequest,
|
||||
|
||||
Reference in New Issue
Block a user