7 Commits

Author SHA1 Message Date
v6ole 24d844bf44 fix: /crawl/sources 包含独立爬虫来源 + trigger 支持 spider_name
- sources 接口原来只返回 GXGP 子来源,遗漏了大化县政府网
- trigger 接口现在支持 spider_name 参数指定单个爬虫
2026-05-10 14:22:58 +08:00
v6ole 1f18d2ec87 feat: 添加中国节假日感知定时功能
- 新增 chinese_holidays 表,通过 timor.tech API 同步节假日数据
- 修正 holiday 字段解读:holiday=true → 休息日,holiday=false → 调休工作日
- 工作日 8:00-22:00 每小时爬取,周末/节假日/夜间自动跳过
- 新增 /api/v1/holidays/sync 和 /api/v1/holidays/today 接口
- 企微菜单新增「同步节假日」按钮,支持手动触发同步
2026-05-09 18:27:27 +08:00
v6ole cbeb3c3504 fix: 连接 Pipeline 到爬取流程 + 夜间跳过 + 断网恢复
- CrawlService.run_spider 现在自动调用 PostCrawlPipeline(爬取→存储→筛选→去重→推送)
- 定时任务添加 22:00-06:00 夜间跳过逻辑
- 断网恢复后不会漏公告:爬虫每次从 API 按日期倒序抓取,未推送的公告下次自动补推
- Pipeline 的 _exclude_sent + mark_sent 防止重复推送
2026-05-09 16:10:30 +08:00
v6ole b3953bb71c fix: 修复公告列表 start_date/end_date 参数未转换为 date 对象导致 500 错误 2026-05-09 15:41:09 +08:00
v6ole 808f3101e3 fix: 修复公告 API 路由顺序 — /today 和 /stats 在 /{id} 之前匹配
将具体路由移到参数化路由之前,避免 "today"/"stats" 被 {announcement_id} 作为整数解析而返回 422。
2026-05-09 15:19:49 +08:00
v6ole 7455d7e426 chore: ruff 代码检查与修复
130 issues auto-fixed (import ordering, UP045/UP006 type annotations),
33 issues manually fixed (E712/E501/E402/E722 + N818 rename + per-file
wechat ignore for N8xx naming conventions). All 33 tests pass.
2026-05-09 14:28:09 +08:00
v6ole a0a06dfd8c feat: 添加 API 路由(公告/爬取/微信回调/调度器)+ 健康检查测试 2026-05-09 14:19:11 +08:00