feat: 账号配额支持固定时间重置模式
- 后端新增 rolling/fixed 两种配额重置模式,支持日配额和周配额 - fixed 模式下可配置重置时刻(小时)、重置星期几(周配额)及时区(IANA) - 在 account_repo.go 中使用 SQL 表达式适配两种模式的过期判断与重置时间推进 - 新增 ComputeQuotaResetAt / ValidateQuotaResetConfig 等辅助函数 - DTO 层新增相关字段并在 mappers 中完整映射 - 前端 QuotaLimitCard 新增 rolling/fixed 切换 UI、时区选择器 - CreateAccountModal / EditAccountModal 透传新配置字段 - i18n(zh/en)同步新增相关翻译词条
This commit is contained in:
@@ -727,6 +727,16 @@ export interface Account {
|
||||
quota_weekly_limit?: number | null
|
||||
quota_weekly_used?: number | null
|
||||
|
||||
// 配额固定时间重置配置
|
||||
quota_daily_reset_mode?: 'rolling' | 'fixed' | null
|
||||
quota_daily_reset_hour?: number | null
|
||||
quota_weekly_reset_mode?: 'rolling' | 'fixed' | null
|
||||
quota_weekly_reset_day?: number | null
|
||||
quota_weekly_reset_hour?: number | null
|
||||
quota_reset_timezone?: string | null
|
||||
quota_daily_reset_at?: string | null
|
||||
quota_weekly_reset_at?: string | null
|
||||
|
||||
// 运行时状态(仅当启用对应限制时返回)
|
||||
current_window_cost?: number | null // 当前窗口费用
|
||||
active_sessions?: number | null // 当前活跃会话数
|
||||
|
||||
Reference in New Issue
Block a user