feat(imitation): add article imitation create flow
Introduce 仿写创作: new list and create views, backend imitation service and prompt templates, worker task routing for imitation jobs, and one-click rewrite triggers from question citation sources. Surface source article URL/title on article list/detail, and restrict failed articles to delete-only. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -241,7 +241,7 @@ func (s *TemplateService) SaveDraft(ctx context.Context, templateID int64, req S
|
||||
AND template_id = $4
|
||||
AND source_type = 'template'
|
||||
AND deleted_at IS NULL
|
||||
AND generate_status IN ('draft', 'failed')
|
||||
AND generate_status = 'draft'
|
||||
RETURNING id
|
||||
`, stateJSON, *req.ArticleID, actor.TenantID, templateID).Scan(&articleID)
|
||||
if err != nil {
|
||||
@@ -333,7 +333,7 @@ func (s *TemplateService) Generate(ctx context.Context, templateID int64, req Ge
|
||||
AND template_id = $3
|
||||
AND source_type = 'template'
|
||||
AND deleted_at IS NULL
|
||||
AND generate_status IN ('draft', 'failed')
|
||||
AND generate_status = 'draft'
|
||||
FOR UPDATE
|
||||
`, *req.ArticleID, actor.TenantID, templateID).Scan(&articleID)
|
||||
if err != nil {
|
||||
@@ -630,6 +630,8 @@ func generationFailureStageLabel(stage string) string {
|
||||
return "AI 正文生成失败"
|
||||
case "knowledge_resolve":
|
||||
return "知识库检索失败"
|
||||
case "source_fetch":
|
||||
return "源文章抓取失败"
|
||||
case "persist_begin_tx":
|
||||
return "写入生成结果事务启动失败"
|
||||
case "persist_create_version":
|
||||
|
||||
Reference in New Issue
Block a user