提取 AsyncJobRepository 泛型基类,消除 CampaignAnalysisRepository 和 CampaignPeriodComparisonRepository 的重复代码。基类提供 get_by_campaign 和 mark_orphans_failed 通用逻辑,子类只需指定 _table 类型和实现 upsert。 - 新增 AsyncJobRepository[DB] 泛型基类 - mark_orphans_failed 接受 error_message 参数,子类传入特定错误信息 - 删除约 60 行重复代码(两个 __init__、两个 get_by_campaign、两个 mark_orphans_failed 实现) - 所有测试通过,行为不变 |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| db.py | ||
| file_repository.py | ||
| file_storage.py | ||
| model_config_repository.py | ||
| repository.py | ||