mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-03 01:40:21 +08:00
perf(usage): 将 status 过滤下推到 SQL 查询层
为 UsageAuditListQuery 新增 statuses 字段,支持在数据库端按状态 筛选用量记录。admin usage summary 路由不再全量拉取后内存过滤, 改为直接查询 pending/streaming 状态的记录。
This commit is contained in:
@@ -485,6 +485,7 @@ async fn dashboard_list_usage_for_range(
|
||||
user_id: user_id.map(ToOwned::to_owned),
|
||||
provider_name: None,
|
||||
model: None,
|
||||
statuses: None,
|
||||
})
|
||||
.await
|
||||
{
|
||||
@@ -1213,6 +1214,7 @@ pub(super) async fn handle_dashboard_provider_status_get(
|
||||
user_id: None,
|
||||
provider_name: None,
|
||||
model: None,
|
||||
statuses: None,
|
||||
})
|
||||
.await
|
||||
{
|
||||
|
||||
@@ -879,6 +879,7 @@ pub(super) async fn handle_users_me_usage_active_get(
|
||||
user_id: Some(auth.user.id.clone()),
|
||||
provider_name: None,
|
||||
model: None,
|
||||
statuses: None,
|
||||
})
|
||||
.await
|
||||
{
|
||||
@@ -950,6 +951,7 @@ pub(super) async fn handle_users_me_usage_interval_timeline_get(
|
||||
user_id: Some(auth.user.id.clone()),
|
||||
provider_name: None,
|
||||
model: None,
|
||||
statuses: None,
|
||||
})
|
||||
.await
|
||||
{
|
||||
|
||||
@@ -217,6 +217,7 @@ pub(super) async fn handle_wallet_today_cost(
|
||||
user_id: Some(auth.user.id.clone()),
|
||||
provider_name: None,
|
||||
model: None,
|
||||
statuses: None,
|
||||
})
|
||||
.await
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user