add log store and types

This commit is contained in:
2026-03-20 15:29:36 +08:00
parent 8948ce7d5a
commit f5e873d1ae
3 changed files with 240 additions and 0 deletions
+51
View File
@@ -253,6 +253,57 @@ export interface DashboardBreakdownParams {
data_type?: string
}
/** ─── 请求日志 ─── */
export interface RequestLogRecord {
id: number
user_id: number | null
method: string
path: string
status_code: number
ip: string
response_code: number
duration_ms: number
created_at: string
}
export interface RequestLogDetail extends RequestLogRecord {
user_agent: string | null
request_body: Record<string, unknown> | null
}
export interface RequestLogFilters {
user_id: number | undefined
method: string | undefined
path: string
status_code: number | undefined
created_at_range: [string, string] | null
}
/** ─── 操作日志 ─── */
export interface OperationLogRecord {
id: number
user_id: number | null
action: string
target_type: string
target_id: number
description: string
ip: string
created_at: string
}
export interface OperationLogDetail extends OperationLogRecord {
detail: Record<string, unknown> | null
}
export interface OperationLogFilters {
user_id: number | undefined
action: string | undefined
target_type: string | undefined
created_at_range: [string, string] | null
}
/** 业务异常 */
export class ApiError extends Error {
code: number