feat(M08-D): 补审计日志与系统配置

This commit is contained in:
Codex
2026-08-10 13:28:54 +08:00
parent bd00aa6275
commit 7e170e8743
13 changed files with 794 additions and 3 deletions
+27
View File
@@ -1,6 +1,7 @@
import type {
Advertisement,
AdvertisementInput,
AuditLog,
CleaningSettlement,
CleaningSettlementDetail,
CleaningStatistics,
@@ -33,6 +34,7 @@ import type {
PayoutStateFilter,
StaffRole,
SettlementStatus,
SystemOverview,
TaskStatus,
TransferMode,
RoomConfigurationStatus,
@@ -532,6 +534,31 @@ export function addFranchiseFollowUp(session: ApiSession, applicationId: string,
{ method: 'POST', body: JSON.stringify(input) });
}
export function listAuditLogs(session: ApiSession, input: {
page: number; pageSize: number; action?: string; resourceType?: string; search?: string;
from?: string; to?: string;
}) {
const params = new URLSearchParams({ page: String(input.page), pageSize: String(input.pageSize) });
if (input.action) params.set('action', input.action);
if (input.resourceType) params.set('resourceType', input.resourceType);
if (input.search) params.set('search', input.search);
if (input.from) params.set('from', input.from);
if (input.to) params.set('to', input.to);
return request<PageResult<AuditLog>>(session, `/audit-logs?${params}`);
}
export function getSystemOverview(session: ApiSession) {
return request<SystemOverview>(session, '/system/overview');
}
export function updateTenantSystemConfig(session: ApiSession, input: {
name: string; timezone: string; status?: 'ACTIVE' | 'DISABLED';
}) {
return request<{ tenantId: string; updated: boolean }>(session, '/system/tenant', {
method: 'PUT', body: JSON.stringify(input)
});
}
export function createStaffUser(
session: ApiSession,
input: { nickname: string; phone: string; note?: string; roles: StaffRole[]; storeIds: string[] }