feat: 内容数据迁移至数据库,合规审查全链路打通

- 文章 HTML 存储从文件系统迁移至 articles 表,删除 releases 目录
- 合规审查从 DB 读取 HTML,审查结果写回 DB,通过后自动推进至待发布
- 新增 todayCount 筛选按钮,与系统概览统计数据一致
- 全屏预览修复:提升 z-index 超过侧边栏,添加退出全屏/关闭按钮
- 统一 '优化' → '审查' 命名,消除前后端术语不一致
- 调度器创作完成后自动触发审查(生成 → 审查 → 待发布)
- 清理旧备份/调试文件、过期大纲和研究笔记
This commit is contained in:
Yuzhiran Dev
2026-05-13 17:33:56 +08:00
parent bc6a302e59
commit 233e23016c
234 changed files with 5670 additions and 10651 deletions
+24 -21
View File
@@ -1,46 +1,50 @@
#!/usr/bin/env python3
import json, datetime
import sys, datetime
from pathlib import Path
from collections import Counter
PROJECT_ROOT = Path(__file__).parent.parent
data_dir = PROJECT_ROOT / "automation" / "data"
releases_dir = data_dir / "releases" / "2026-04-16"
drafts_dir = data_dir / "drafts" / "2026-04-16"
sys.path.insert(0, str(PROJECT_ROOT))
# 1. 选题状态
topics = json.load(open(data_dir / "sustainability_topics.json", encoding='utf-8'))
from db_helper import export_topics_to_json
DATA_DIR = PROJECT_ROOT / "automation" / "data"
TODAY = datetime.date.today().isoformat()
releases_dir = DATA_DIR / "releases" / TODAY
drafts_dir = DATA_DIR / "drafts" / TODAY
topics = export_topics_to_json()
by_status = {}
for t in topics:
s = t.get('status','待处理')
s = t.get('status', '待处理')
by_status.setdefault(s, []).append(t)
print(f"📊 宇之然内容生成系统状态报告 ({datetime.date.today()})")
print(f"\U0001f4ca 宇之然内容生成系统状态报告 ({TODAY})")
print(f"\n=== 1. 选题库总览 ===")
print(f"总选题数: {len(topics)}")
for s, arr in sorted(by_status.items()):
print(f" {s}: {len(arr)}")
# 2. 今日生成内容
print(f"\n=== 2. 今日 (2026-04-16) 已生成内容 ===")
print(f"\n=== 2. 今日 ({TODAY}) 已生成内容 ===")
if releases_dir.exists():
zhihu = list((releases_dir / 'zhihu').glob('*.html'))
wechat = list((releases_dir / 'wechat').glob('*.html'))
xhs = list((releases_dir / 'xiaohongshu').glob('*.html'))
zhihu = list((releases_dir / 'zhihu').glob('*.html')) if (releases_dir / 'zhihu').exists() else []
wechat = list((releases_dir / 'wechat').glob('*.html')) if (releases_dir / 'wechat').exists() else []
xhs = list((releases_dir / 'xiaohongshu').glob('*.html')) if (releases_dir / 'xiaohongshu').exists() else []
print(f" 知乎: {len(zhihu)}")
print(f" 微信公众号: {len(wechat)}")
print(f" 小红书: {len(xhs)}")
# 列出选题ID
topic_ids = set()
for f in zhihu:
topic_ids.add(f.stem.split('_')[1])
print(f" 涉及选题ID: {', '.join(sorted(topic_ids))}")
if topic_ids:
print(f" 涉及选题ID: {', '.join(sorted(topic_ids))}")
else:
print(" 今日无发布内容")
# 3. 合规与优化结果
report_file = drafts_dir / "optimization_report.json"
if report_file.exists():
report = json.load(open(report_file, encoding='utf-8'))
import json
report = json.loads(report_file.read_text(encoding='utf-8'))
print(f"\n=== 3. 合规优化结果 ===")
sm = report['summary']
print(f" 总文章数: {sm['total_articles']}")
@@ -50,14 +54,13 @@ if report_file.exists():
if sm['need_manual'] == 0:
print(" ✅ 所有文章均已自动合规")
else:
print("\n=== 3. 合规优化结果 ===")
print(f"\n=== 3. 合规优化结果 ===")
print(" 未找到优化报告")
# 4. 待发布选题(可发布)
ready = by_status.get('ready', [])
print(f"\n=== 4. 待发布选题(已合规)===")
ready = by_status.get('待发布', [])
if ready:
for t in sorted(ready, key=lambda x: x.get('priority_score',0), reverse=True):
for t in sorted(ready, key=lambda x: x.get('priority_score', 0), reverse=True):
print(f" {t['id']}: {t['title'][:50]}")
else:
print(" 暂无待发布选题")