OG T
|
d89f0520f9
|
fix(api): 修復 34 個 Ruff lint 錯誤
- 自動修復 import 排序、unused imports
- 手動修復 raise from、isinstance union、unused variable
- scripts/ 暫時保留 (非 CI 阻擋)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-03-29 15:27:49 +08:00 |
|
OG T
|
30153496d1
|
fix(api): 修復全部 lint 錯誤 (ruff --fix)
- Import sorting (I001)
- Unused imports (F401)
- f-string without placeholders (F541)
- Loop variable unused (B007)
- zip() strict parameter (B905)
- Exception chaining (B904)
- collections.abc imports (UP035)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-03-26 16:06:20 +08:00 |
|
OG T
|
a470a514e6
|
refactor(api): Phase 17 P0 Router 層違規全部修復
消除 Router 層直接存取 Redis/DB 的違規:
incidents.py (6 處):
- 改用 IncidentService.get_active_incidents()
- 改用 IncidentService.get_from_working_memory()
- 改用 IncidentService.update_outcome()
- 改用 IncidentService.resolve_incident()
- 改用 IncidentService.find_by_proposal_id()
stats.py (8 處):
- 新增 StatsService 封裝快取邏輯
- 移除直接 Redis 存取
audit_logs.py (7 處):
- 新增 AuditLogRepository 封裝 DB 操作
- Router 改用 Repository 層
webhooks.py (2 處):
- 新增 SignalProducerService 封裝 Redis Stream
- 改用 IncidentService.save_to_working_memory()
符合 leWOOOgo 積木化規範:
Router → Service → Repository → DB/Redis
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
2026-03-26 13:06:47 +08:00 |
|