perf(usage): user-me usage 查询避免全量加载,默认限制 7 天范围

- UsageAuditListQuery 新增 limit 字段,支持在 SQL 层 LIMIT
- user-me usage 端点无时间范围时默认查最近 7 天
- active usage 端点无 ids 过滤时限制查最近 1 小时
- InMemory 实现同步支持 limit truncate
This commit is contained in:
fawney19
2026-04-15 16:25:57 +08:00
parent fbb8249c0d
commit 43e7ad112f
8 changed files with 37 additions and 2 deletions

View File

@@ -481,6 +481,7 @@ pub struct UsageAuditListQuery {
pub provider_name: Option<String>,
pub model: Option<String>,
pub statuses: Option<Vec<String>>,
pub limit: Option<usize>,
}
#[derive(Debug, Clone, PartialEq, Default, serde::Serialize, serde::Deserialize)]