feat: GEO/SEO structured data + search ranking tracker

This commit is contained in:
Yuzhiran Dev
2026-06-09 17:18:09 +08:00
parent 23ff63baa9
commit 8595bbc521
26 changed files with 961 additions and 51 deletions
+7 -1
View File
@@ -236,7 +236,7 @@ def save_topics_to_db(topics_data: List[Dict]):
finally:
db.close()
def save_article(topic_id: str, platform: str, html_content: str, db: Optional[Session] = None) -> Dict:
def save_article(topic_id: str, platform: str, html_content: str, *, title: str = "", content: str = "", db: Optional[Session] = None) -> Dict:
"""保存/更新文章到 articles 表"""
close_db = False
if db is None:
@@ -249,12 +249,18 @@ def save_article(topic_id: str, platform: str, html_content: str, db: Optional[S
now = datetime.now()
if existing:
existing.html_content = html_content
if title:
existing.title = title
if content:
existing.content = content
else:
article = Article(
id=article_id,
topic_id=topic_id,
platform=platform,
file_path=f"db:{article_id}",
title=title,
content=content,
html_content=html_content,
status="draft",
compliance_score=None