模板在线编辑与导出链路重构

This commit is contained in:
zwt13703
2026-07-05 23:35:00 +08:00
parent 1369d87afb
commit c84ec6aa71
15 changed files with 1434 additions and 166 deletions
+24
View File
@@ -43,8 +43,32 @@ class ParagraphConfig(BaseModel):
file_note: str = ""
output_format: str = "text"
class TemplateBlockConfig(BaseModel):
id: int = 0
source_paragraph_id: Optional[int] = None
parent_block_id: Optional[int] = None
sort_index: int = 0
block_type: str = "text"
anchor_ref: str = ""
title: str = ""
content_json: dict[str, Any] = Field(default_factory=dict)
style_json: str = "{}"
edit_mode: str = "manual"
placeholder_key: str = ""
variable_key: str = ""
default_value: str = ""
model_id: Optional[int] = None
need_prompt: bool = True
prompt_text: str = ""
need_file: bool = False
file_note: str = ""
output_format: str = "text"
class TemplateSave(BaseModel):
save_mode: str = "paragraph"
paragraphs: list[ParagraphConfig] = []
blocks: list[TemplateBlockConfig] = []
# 模型
class AiModelCreate(BaseModel):