refactor event

This commit is contained in:
Timi
2026-08-05 22:50:22 +08:00
parent 22ff13b1fe
commit 1243068fc3
46 changed files with 961 additions and 789 deletions
+47
View File
@@ -0,0 +1,47 @@
import { axios, type Page, type PageResult } from "timi-web";
import type { EventItem } from "@/types/EventItem";
const BASE_URI = "/gao/event";
async function list(req: Page<EventItem>): Promise<PageResult<EventItem>> {
return await axios.post(`${BASE_URI}/list`, req);
}
async function enabledList(): Promise<EventItem[]> {
return await axios.post(`${BASE_URI}/list/valid`);
}
async function detail(id: string): Promise<EventItem> {
return await axios.post(`${BASE_URI}/detail`, undefined, {
params: { id }
});
}
async function create(req: EventItem): Promise<void> {
return await axios.post(`${BASE_URI}/create`, req);
}
async function update(req: EventItem): Promise<void> {
return await axios.post(`${BASE_URI}/update`, req);
}
async function sort(idList: string[]): Promise<void> {
return await axios.post(`${BASE_URI}/sort`, idList);
}
async function remove(id: string): Promise<void> {
return await axios.post(`${BASE_URI}/delete`, undefined, {
params: { id }
});
}
export default {
list,
enabledList,
detail,
create,
update,
sort,
remove
};