mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-08-01 04:02:02 +08:00
feat(services): add pagination and enhanced filtering for request logs
Usage stats service: - Change get_request_logs() from limit/offset to page/page_size pagination - Return PaginatedLogs with total count, page, and page_size - Add appType and providerName filters with LIKE search - Add is_streaming, first_token_ms, duration_ms to RequestLogDetail - Join with providers table for provider name lookup Commands: - Update get_request_logs command signature for pagination params Module exports: - Export PaginatedLogs struct
This commit is contained in:
@@ -41,10 +41,10 @@ pub fn get_model_stats(state: State<'_, AppState>) -> Result<Vec<ModelStats>, Ap
|
||||
pub fn get_request_logs(
|
||||
state: State<'_, AppState>,
|
||||
filters: LogFilters,
|
||||
limit: u32,
|
||||
offset: u32,
|
||||
) -> Result<Vec<RequestLogDetail>, AppError> {
|
||||
state.db.get_request_logs(&filters, limit, offset)
|
||||
page: u32,
|
||||
page_size: u32,
|
||||
) -> Result<PaginatedLogs, AppError> {
|
||||
state.db.get_request_logs(&filters, page, page_size)
|
||||
}
|
||||
|
||||
/// 获取单个请求详情
|
||||
|
||||
Reference in New Issue
Block a user