Phase3: 三平台封面图生成

- cover_generator.py: Pillow生成知乎/微信/小红书封面图(渐变背景+标题)
- 知乎 1200×630 蓝调, 微信 900×500 绿调, 小红书 1080×1440 红调
- creator.py 流水线增加 cover_generator 作为最终回退
- db_helper.py 新增 save_cover_to_article
- main.py 挂载 /automation/images 静态目录
- articles.py preview 接口返回 images 字段
- topics.html 预览dialog展示封面图
This commit is contained in:
Yuzhiran Dev
2026-05-20 19:12:58 +08:00
parent 40a77cad2c
commit c8bee712d7
6 changed files with 237 additions and 5 deletions
+1 -1
View File
@@ -138,7 +138,7 @@ def preview_article(topic_id: str, platform: str = "zhihu", current_user: User =
article = db.query(Article).filter(Article.id == article_id).first()
if not article or not article.html_content:
raise HTTPException(status_code=404, detail=f"Article not found for {topic_id} on {platform}")
return {"topic_id": topic_id, "platform": platform, "html": article.html_content}
return {"topic_id": topic_id, "platform": platform, "html": article.html_content, "images": article.images or {}}
@router.put("/{topic_id}/content")
def update_article_content(