init project

This commit is contained in:
Timi
2026-08-01 18:01:23 +08:00
parent 286fa1ba56
commit 11c48bf00c
107 changed files with 19350 additions and 1 deletions
+107
View File
@@ -0,0 +1,107 @@
import { axios, type Page, type PageResult } from "timi-web";
import type { Customer, CustomerDailyStatView, CustomerGenderStatView, CustomerInviteUpdateReq, CustomerSearchReq, CustomerTrendStatReq, QuickRegisterReq } from "@/types/Customer";
import type { RegistrationEventRecord } from "@/types/RegistrationEventRecord";
const BASE_URI = "/gao/customer";
async function list(req: Page<Customer>): Promise<PageResult<Customer>> {
return await axios.post(`${BASE_URI}/list`, req);
}
async function search(req: CustomerSearchReq): Promise<Customer[]> {
return await axios.post(`${BASE_URI}/search`, req);
}
async function searchPage(req: Page<CustomerSearchReq>): Promise<PageResult<Customer>> {
return await axios.post(`${BASE_URI}/search/page`, req);
}
async function exportExcel(req: CustomerSearchReq): Promise<Blob> {
return await axios.post(`${BASE_URI}/export`, req, {
responseType: "blob"
});
}
async function detail(id: string): Promise<Customer> {
return await axios.post(`${BASE_URI}/detail`, undefined, {
params: { id }
});
}
async function detailByCode(code: string): Promise<Customer> {
return await axios.post(`${BASE_URI}/detail/code`, undefined, {
params: { code }
});
}
async function nullableDetailByCode(code: string): Promise<Customer | null> {
return await axios.post(`${BASE_URI}/detail/code/nullable`, undefined, {
params: { code }
});
}
async function invitedList(introducerCustomerId: string): Promise<Customer[]> {
return await axios.post(`${BASE_URI}/invited/list`, undefined, {
params: { introducerCustomerId }
});
}
async function create(req: Customer): Promise<Customer> {
return await axios.post(`${BASE_URI}/create`, req);
}
async function quickRegister(req: QuickRegisterReq): Promise<RegistrationEventRecord> {
return await axios.post(`${BASE_URI}/quick/register`, req);
}
async function update(req: Customer): Promise<void> {
return await axios.post(`${BASE_URI}/update`, req);
}
async function remove(id: string): Promise<void> {
return await axios.post(`${BASE_URI}/delete`, undefined, {
params: { id }
});
}
async function createInvite(req: CustomerInviteUpdateReq): Promise<void> {
return await axios.post(`${BASE_URI}/invite/create`, req);
}
async function updateInvite(req: CustomerInviteUpdateReq): Promise<void> {
return await axios.post(`${BASE_URI}/invite/update`, req);
}
async function deleteInvite(customerId: string): Promise<void> {
return await axios.post(`${BASE_URI}/invite/delete`, undefined, {
params: { customerId }
});
}
async function dailyStat(req: CustomerTrendStatReq): Promise<CustomerDailyStatView[]> {
return await axios.post(`${BASE_URI}/stat/daily`, req);
}
async function genderStat(): Promise<CustomerGenderStatView[]> {
return await axios.post(`${BASE_URI}/stat/gender`);
}
export default {
list,
search,
searchPage,
exportExcel,
detail,
detailByCode,
nullableDetailByCode,
invitedList,
create,
quickRegister,
update,
remove,
createInvite,
updateInvite,
deleteInvite,
dailyStat,
genderStat
};
+41
View File
@@ -0,0 +1,41 @@
import { axios, type Page, type PageResult, type Role } from "timi-web";
import type { GaoUser } from "@/types/GaoUser";
const BASE_URI = "/gao/user";
async function list(req: Page<GaoUser>): Promise<PageResult<GaoUser>> {
return await axios.post(`${BASE_URI}/list`, req);
}
async function detail(id: string): Promise<GaoUser> {
return await axios.post(`${BASE_URI}/detail`, undefined, {
params: { id }
});
}
async function create(req: GaoUser): Promise<GaoUser> {
return await axios.post(`${BASE_URI}/create`, req);
}
async function update(req: GaoUser): Promise<GaoUser> {
return await axios.post(`${BASE_URI}/update`, req);
}
async function remove(id: string): Promise<void> {
return await axios.post(`${BASE_URI}/delete`, undefined, {
params: { id }
});
}
async function roleList(): Promise<Role[]> {
return await axios.post(`${BASE_URI}/role/list`);
}
export default {
list,
detail,
create,
update,
remove,
roleList
};
+41
View File
@@ -0,0 +1,41 @@
import { axios, type Page, type PageResult } from "timi-web";
import type { RegistrationEvent } from "@/types/RegistrationEvent";
const BASE_URI = "/gao/registration-event";
async function list(req: Page<RegistrationEvent>): Promise<PageResult<RegistrationEvent>> {
return await axios.post(`${BASE_URI}/list`, req);
}
async function enabledList(): Promise<RegistrationEvent[]> {
return await axios.post(`${BASE_URI}/enabled/list`);
}
async function detail(id: string): Promise<RegistrationEvent> {
return await axios.post(`${BASE_URI}/detail`, undefined, {
params: { id }
});
}
async function create(req: RegistrationEvent): Promise<void> {
return await axios.post(`${BASE_URI}/create`, req);
}
async function update(req: RegistrationEvent): Promise<void> {
return await axios.post(`${BASE_URI}/update`, req);
}
async function remove(id: string): Promise<void> {
return await axios.post(`${BASE_URI}/delete`, undefined, {
params: { id }
});
}
export default {
list,
enabledList,
detail,
create,
update,
remove
};
+88
View File
@@ -0,0 +1,88 @@
import { axios, type Page, type PageResult } from "timi-web";
import type {
CustomerRegisterStatView,
RegistrationEventRecordCalendarView,
RegistrationEventRecord,
RegistrationEventRecordCreateReq,
RegistrationEventRecordDailyStatView,
RegistrationEventRecordListItemView,
RegistrationEventRecordRangeReq,
RegistrationEventRecordStatReq,
RegistrationEventRecordTrendStatReq
} from "@/types/RegistrationEventRecord";
const BASE_URI = "/gao/registration-event-record";
async function list(req: Page<RegistrationEventRecord>): Promise<PageResult<RegistrationEventRecord>> {
return await axios.post(`${BASE_URI}/list`, req);
}
async function detail(id: string): Promise<RegistrationEventRecord> {
return await axios.post(`${BASE_URI}/detail`, undefined, {
params: { id }
});
}
async function rangeList(req: RegistrationEventRecordRangeReq): Promise<RegistrationEventRecord[]> {
return await axios.post(`${BASE_URI}/range/list`, req);
}
async function calendarRangeList(req: RegistrationEventRecordRangeReq): Promise<RegistrationEventRecordCalendarView[]> {
return await axios.post(`${BASE_URI}/range/calendar/list`, req);
}
async function rangePage(req: Page<RegistrationEventRecordRangeReq>): Promise<PageResult<RegistrationEventRecordListItemView>> {
return await axios.post(`${BASE_URI}/range/page`, req);
}
async function rangeExport(req: RegistrationEventRecordRangeReq): Promise<Blob> {
return await axios.post(`${BASE_URI}/range/export`, req, {
responseType: "blob"
});
}
async function create(req: RegistrationEventRecordCreateReq): Promise<RegistrationEventRecord> {
return await axios.post(`${BASE_URI}/create`, req);
}
async function update(req: RegistrationEventRecord): Promise<void> {
await axios.post(`${BASE_URI}/update`, req);
}
async function remove(id: string): Promise<void> {
await axios.post(`${BASE_URI}/delete`, undefined, {
params: { id }
});
}
async function customerRangeStat(req: RegistrationEventRecordStatReq): Promise<CustomerRegisterStatView[]> {
return await axios.post(`${BASE_URI}/customer/range/stat`, req);
}
async function allCustomerRangeStat(req: RegistrationEventRecordStatReq): Promise<CustomerRegisterStatView[]> {
return await axios.post(`${BASE_URI}/all-customer/range/stat`, req);
}
async function customerRegistrationEventDailyStat(req: RegistrationEventRecordTrendStatReq): Promise<RegistrationEventRecordDailyStatView[]> {
return await axios.post(`${BASE_URI}/customer/registration-event/daily/stat`, req);
}
async function allCustomerRegistrationEventDailyStat(req: RegistrationEventRecordTrendStatReq): Promise<RegistrationEventRecordDailyStatView[]> {
return await axios.post(`${BASE_URI}/all-customer/registration-event/daily/stat`, req);
}
export default {
list,
detail,
rangeList,
calendarRangeList,
rangePage,
rangeExport,
create,
update,
remove,
customerRangeStat,
allCustomerRangeStat,
customerRegistrationEventDailyStat,
allCustomerRegistrationEventDailyStat
};