新增: - ILearningRepository Protocol (interfaces.py) - LearningRepository (Redis 持久化層) - Learning API 端點 (/api/v1/learning/*) - LearningService.get_recommended_fix() 方法 - LearningService.get_learning_summary() 方法 修正: - Service 不直接依賴 Redis Client (透過 Repository) - 符合 leWOOOgo 積木化原則 - 首席架構師審查: 74/100 → 92/100 更新: - ADR-030: 新增 Phase D-G P0 修正章節 - Skill 02: v1.9 → v2.0 - Runner 修復: 序列建構解決 _runner_file_commands 衝突 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
58 lines
1.3 KiB
Python
58 lines
1.3 KiB
Python
"""
|
|
Repository Layer - 資料存取抽象層
|
|
==================================
|
|
Phase 16 R3: 抽取 Repository 層
|
|
|
|
設計原則:
|
|
- Protocol 介面定義 (DI 用)
|
|
- CRUD 操作封裝
|
|
- Service 層不直接碰 DB/Redis
|
|
|
|
版本: v1.0
|
|
建立: 2026-03-26 (台北時區)
|
|
建立者: Claude Code (Phase 16 架構重構)
|
|
"""
|
|
|
|
from src.repositories.approval_repository import (
|
|
ApprovalDBRepository,
|
|
get_approval_repository,
|
|
)
|
|
from src.repositories.incident_repository import (
|
|
IncidentDBRepository,
|
|
get_incident_repository,
|
|
)
|
|
from src.repositories.interfaces import (
|
|
IApprovalRepository,
|
|
IIncidentRepository,
|
|
ILearningRepository,
|
|
IMetricsRepository,
|
|
ITimelineRepository,
|
|
)
|
|
from src.repositories.learning_repository import (
|
|
LearningRepository,
|
|
get_learning_repository,
|
|
)
|
|
from src.repositories.metrics_repository import (
|
|
MetricsDBRepository,
|
|
get_metrics_repository,
|
|
)
|
|
|
|
__all__ = [
|
|
# Interfaces
|
|
"IApprovalRepository",
|
|
"IIncidentRepository",
|
|
"ILearningRepository",
|
|
"IMetricsRepository",
|
|
"ITimelineRepository",
|
|
# Implementations
|
|
"ApprovalDBRepository",
|
|
"IncidentDBRepository",
|
|
"LearningRepository",
|
|
"MetricsDBRepository",
|
|
# Getters
|
|
"get_approval_repository",
|
|
"get_incident_repository",
|
|
"get_learning_repository",
|
|
"get_metrics_repository",
|
|
]
|