fix(test): 修复CI测试失败
- 修复gofmt格式问题 - 为stubUsageLogRepo添加缺失的GetApiKeyStatsAggregated方法
This commit is contained in:
@@ -133,9 +133,9 @@ func (r *usageLogRepository) GetDashboardStats(ctx context.Context) (*DashboardS
|
||||
|
||||
// 合并用户统计查询
|
||||
var userStats struct {
|
||||
TotalUsers int64 `gorm:"column:total_users"`
|
||||
TodayNewUsers int64 `gorm:"column:today_new_users"`
|
||||
ActiveUsers int64 `gorm:"column:active_users"`
|
||||
TotalUsers int64 `gorm:"column:total_users"`
|
||||
TodayNewUsers int64 `gorm:"column:today_new_users"`
|
||||
ActiveUsers int64 `gorm:"column:active_users"`
|
||||
}
|
||||
if err := r.db.WithContext(ctx).Raw(`
|
||||
SELECT
|
||||
@@ -168,11 +168,11 @@ func (r *usageLogRepository) GetDashboardStats(ctx context.Context) (*DashboardS
|
||||
|
||||
// 合并账户统计查询
|
||||
var accountStats struct {
|
||||
TotalAccounts int64 `gorm:"column:total_accounts"`
|
||||
NormalAccounts int64 `gorm:"column:normal_accounts"`
|
||||
ErrorAccounts int64 `gorm:"column:error_accounts"`
|
||||
RateLimitAccounts int64 `gorm:"column:ratelimit_accounts"`
|
||||
OverloadAccounts int64 `gorm:"column:overload_accounts"`
|
||||
TotalAccounts int64 `gorm:"column:total_accounts"`
|
||||
NormalAccounts int64 `gorm:"column:normal_accounts"`
|
||||
ErrorAccounts int64 `gorm:"column:error_accounts"`
|
||||
RateLimitAccounts int64 `gorm:"column:ratelimit_accounts"`
|
||||
OverloadAccounts int64 `gorm:"column:overload_accounts"`
|
||||
}
|
||||
if err := r.db.WithContext(ctx).Raw(`
|
||||
SELECT
|
||||
|
||||
@@ -922,6 +922,10 @@ func (r *stubUsageLogRepo) GetUserUsageTrend(ctx context.Context, startTime, end
|
||||
return nil, errors.New("not implemented")
|
||||
}
|
||||
|
||||
func (r *stubUsageLogRepo) GetApiKeyStatsAggregated(ctx context.Context, apiKeyID int64, startTime, endTime time.Time) (*usagestats.UsageStats, error) {
|
||||
return nil, errors.New("not implemented")
|
||||
}
|
||||
|
||||
func (r *stubUsageLogRepo) GetBatchUserUsageStats(ctx context.Context, userIDs []int64) (map[int64]*usagestats.BatchUserUsageStats, error) {
|
||||
return nil, errors.New("not implemented")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user