forked from wangziqi/gongxue-base
feat: add platform audit export
This commit is contained in:
@@ -223,6 +223,18 @@ export interface PlatformAuditLogItem {
|
||||
createdAt?: string | null;
|
||||
}
|
||||
|
||||
export interface PlatformAuditExportItem {
|
||||
filename?: string | null;
|
||||
format?: string | null;
|
||||
mimeType?: string | null;
|
||||
rowCount?: number | string | null;
|
||||
exportedAt?: string | null;
|
||||
sha256?: string | null;
|
||||
sizeBytes?: number | string | null;
|
||||
contentBase64?: string | null;
|
||||
filters?: Record<string, unknown> | null;
|
||||
}
|
||||
|
||||
export interface CreatePlatformTenantInput {
|
||||
slug: string;
|
||||
name: string;
|
||||
@@ -342,6 +354,23 @@ export async function loadPlatformAuditLogs(query: { tenantId?: string; action?:
|
||||
});
|
||||
}
|
||||
|
||||
export async function exportPlatformAuditLogs(query: {
|
||||
tenantId?: string;
|
||||
action?: string;
|
||||
targetType?: string;
|
||||
actorUserId?: string;
|
||||
q?: string;
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
format?: 'csv' | 'json';
|
||||
limit?: number;
|
||||
} = {}) {
|
||||
return apiRequest<{ item?: PlatformAuditExportItem }>('/api/platform-admin/audit-logs/export', {
|
||||
query: { format: 'csv', ...query, limit: query.limit || 1000 },
|
||||
tenantId: null,
|
||||
});
|
||||
}
|
||||
|
||||
export async function loadPlatformInvoices(query: { tenantId?: string; status?: string; limit?: number } = {}) {
|
||||
return apiRequest<{ items?: PlatformInvoiceItem[] }>('/api/platform-admin/invoices', {
|
||||
query: { ...query, limit: query.limit || 80 },
|
||||
|
||||
Reference in New Issue
Block a user