feat: M9 日报结构化入库(HTML 改为写入 MySQL news_report/news_event,report_type=intl)

- 新增 report_db/ 包(models/schema/db,复用 news 项目实现,幂等 upsert)
- reporter.py: _build_report_data + generate_report 写库返回 report_id
- pipeline/cli 适配 report_id 返回值;HTML 渲染/上传保留 deprecated
- 新增 tests/test_report_db.py;.env.example 增加 NEWS_DB_* 配置
- 已部署 pi5 并验证:真实生成 report_id=184(12 事件)+ 幂等覆盖
This commit is contained in:
2026-08-04 11:09:17 +08:00
parent e1ec5f836d
commit d4a55bcaaa
14 changed files with 669 additions and 69 deletions
+2
View File
@@ -25,6 +25,7 @@ dependencies = [
"openai>=2.43.0",
"python-dotenv>=1.2.2",
"markdown>=3.10.2",
"pymysql>=1.2.0",
]
[project.optional-dependencies]
@@ -65,6 +66,7 @@ select = ["E", "F", "I", "N", "W", "UP"]
[tool.ruff.lint.per-file-ignores]
"scheduler/reporter.py" = ["E501"] # 内嵌 HTML 模板 CSS 行较长
"report_db/schema.py" = ["E501"] # DDL SQL 语句较长,与 news 项目 schema 保持一致
[tool.pytest.ini_options]
testpaths = ["tests"]