feat: GEO/SEO structured data + search ranking tracker
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user