LifeVta commited on
Commit
12fc2ce
·
verified ·
1 Parent(s): a9f0d16

Update app/control/account/models.py

Browse files
Files changed (1) hide show
  1. app/control/account/models.py +21 -0
app/control/account/models.py CHANGED
@@ -333,7 +333,28 @@ class AccountChangeSet(BaseModel):
333
  class RuntimeSnapshot(BaseModel):
334
  revision: int = 0
335
  items: list[AccountRecord] = Field(default_factory=list)
 
 
 
336
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
337
 
338
  __all__ = [
339
  "QuotaWindow",
 
333
  class RuntimeSnapshot(BaseModel):
334
  revision: int = 0
335
  items: list[AccountRecord] = Field(default_factory=list)
336
+ # ---------------------------------------------------------------------------
337
+ # AuditLog Models (内存审计专属结构)
338
+ # ---------------------------------------------------------------------------
339
 
340
+ class AuditLogRecord(BaseModel):
341
+ """单次调用审计明细"""
342
+ token: str
343
+ request_time: int = Field(default_factory=now_ms)
344
+ device_ip: str = "0.0.0.0"
345
+ user_agent: str = ""
346
+ conversation_id: str | None = None
347
+ quota_type: str # 'auto' | 'fast' | 'expert' | 'heavy' | 'console'
348
+ status: str = "SUCCESS" # SUCCESS | FAIL
349
+
350
+ class QuotaDistributionSummary(BaseModel):
351
+ """额度分布审计统计摘要"""
352
+ quota_type: str
353
+ total_calls: int
354
+ success_calls: int
355
+ fail_calls: int
356
+ top_ips: dict[str, int] = Field(default_factory=dict)
357
+ top_user_agents: dict[str, int] = Field(default_factory=dict)
358
 
359
  __all__ = [
360
  "QuotaWindow",