Commit Graph

11 Commits

Author SHA1 Message Date
shaw
30b95cf5ce fix(usage): 分离 API 响应和窗口统计缓存,修复 5h 窗口未激活时的显示 bug
问题:
1. WindowStats 与 API 响应一起缓存 10 分钟,导致费用数据更新延迟
2. 当 5h 窗口未激活(ResetsAt 为空)时,FiveHour 为 nil,导致所有窗口的 WindowStats 都无法显示

修复:
- 分离缓存:API 响应缓存 10 分钟,窗口统计独立缓存 1 分钟
- RemainingSeconds 每次请求时实时计算
- FiveHour 对象始终创建(即使 ResetsAt 为空)
- addWindowStats 增强防护,支持 FiveHour 为 nil 时仍处理其他窗口
2025-12-28 23:12:44 +08:00
IanShaw027
227d506c53 feat(backend): 增强使用统计和API密钥功能
- 优化使用统计处理逻辑
- 增强API密钥仓储层功能
- 改进账户使用服务
- 完善API契约测试覆盖
2025-12-27 16:03:57 +08:00
Forest
e5a77853b0 refactor: 调整项目结构为单向依赖 2025-12-26 16:45:40 +08:00
Forest
f51ad2e126 refactor: 删除 ports 目录 2025-12-25 17:15:01 +08:00
Forest
836c4dda2b refactor: 重命名 go module 2025-12-24 21:07:21 +08:00
Forest
bbf4024dc7 refactor(usage): 移动 usage 查询到 services 2025-12-24 08:41:31 +08:00
Forest
1fab9204eb ci(backend): 添加 unused 配置 2025-12-20 16:12:44 +08:00
Forest
0338c83b90 ci(backend): 添加 errcheck 配置 2025-12-20 15:52:13 +08:00
Forest
cceada7dae refactor(backend): service http ports 2025-12-20 11:57:02 +08:00
Forest
e99b344b2b refactor(backend): 引入端口接口模式 2025-12-19 21:26:19 +08:00
shaw
642842c29e First commit 2025-12-18 13:50:39 +08:00