- domain/repositories/selection.py + SelectionMeta:选股 Repository Protocol
- models/selection.py + migration a6c91d4e7f20:selection_snapshot(查询/统计快照)+
selection_result(逐候选:rank/score/factor_values/filter_status/reason JSON)
- repositories/selection_impl.py:save/get/list_recent(读回重建 SelectionResult)
- api/selections.py:POST /api/selections(同步执行+落库,返回 selection_id+result)、
GET /{id}、GET 列表(as_of/method 过滤);deps 装配 SelectionService/Repo
- config._build_mysql_url:仅编码破坏 URL 结构的字符(修 Alembic configparser 遇 %21 崩)
- 迁移已在 MySQL 应用(alembic head a6c91d4e7f20);tests/test_selections_api.py 4 例
提交→读回一致/404/列表过滤/condition;全量 pytest 通过
23 lines
648 B
Python
23 lines
648 B
Python
"""ORM 模型目录。
|
|
|
|
新增表流程(AGENT.md §12):Model → Alembic Migration → Test。
|
|
模型统一继承 infra.persistence.sqlalchemy.base.Base。
|
|
"""
|
|
|
|
from app.infrastructure.persistence.sqlalchemy.models.jobs import ( # noqa: F401
|
|
ExperimentModel,
|
|
JobModel,
|
|
)
|
|
from app.infrastructure.persistence.sqlalchemy.models.market import ( # noqa: F401
|
|
AdjustFactorModel,
|
|
FinancialIndicatorModel,
|
|
StockDailyModel,
|
|
StockModel,
|
|
SyncLogModel,
|
|
TradingCalendarModel,
|
|
)
|
|
from app.infrastructure.persistence.sqlalchemy.models.selection import ( # noqa: F401
|
|
SelectionResultModel,
|
|
SelectionSnapshotModel,
|
|
)
|