feat: 新增参考材料后端支持
- 新增 SessionMaterial 模型 - 新增 builder_session_materials 表自动迁移 - BuilderSession 增加 Materials 字段 - CreateBuilderSession/UpdateBuilderSession 支持保存材料 - GetBuilderSession 支持加载材料 - DeleteBuilderSession 支持级联删除材料 - AssemblePrompt 支持组装材料内容到 Prompt
This commit is contained in:
@@ -43,6 +43,7 @@ type BuilderSession struct {
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
Tags []SessionTag `json:"tags,omitempty"`
|
||||
Snippets []SessionSnippet `json:"snippets,omitempty"`
|
||||
Materials []SessionMaterial `json:"materials,omitempty"`
|
||||
}
|
||||
|
||||
// SessionTag 构建会话标签关联
|
||||
@@ -61,6 +62,15 @@ type SessionSnippet struct {
|
||||
SortOrder int `json:"sort_order"`
|
||||
}
|
||||
|
||||
// SessionMaterial 构建会话参考材料
|
||||
type SessionMaterial struct {
|
||||
ID int64 `json:"id"`
|
||||
BuilderSessionID int64 `json:"builder_session_id"`
|
||||
Title string `json:"title"`
|
||||
Content string `json:"content"`
|
||||
SortOrder int `json:"sort_order"`
|
||||
}
|
||||
|
||||
// Prompt prompts 表记录(只读)
|
||||
type Prompt struct {
|
||||
ID int64 `json:"id"`
|
||||
|
||||
Reference in New Issue
Block a user