feat(canvas): 画布工作区 - 整合侧栏与风格预设并修复提示词回填
选择性整合 #547,保留主分支节点与工具条设计。新增默认折叠的节点、资产、任务和历史面板,风格与预设保留在节点内,移除重复入口。 补齐工具权限、提示词解析、资源引用保护及数据库迁移,修复提示词清空和连续编辑后的生成配置同步。 验证:前端全量 1925 项测试、构建、类型检查及 lint 通过;后端 go test ./... 通过。真实模型、PostgreSQL 实库与登录态页面验收仍待进行。 Refs #547 Co-authored-by: bensharp <bensharp@qq.com>
This commit is contained in:
@@ -147,3 +147,32 @@ type UserSkillState struct {
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
type Tool struct {
|
||||
ID int64 `json:"id" gorm:"primaryKey;autoIncrement"`
|
||||
Type string `json:"type" gorm:"size:24;index"`
|
||||
LabelEn string `json:"labelEn" gorm:"size:120;index"`
|
||||
Label string `json:"label" gorm:"size:120"`
|
||||
Desc string `json:"desc" gorm:"size:500"`
|
||||
Tag string `json:"tag" gorm:"size:64;index"`
|
||||
Cover string `json:"cover" gorm:"size:500"`
|
||||
ExtraInfoJSON string `json:"-" gorm:"type:text"`
|
||||
Prompt string `json:"prompt" gorm:"type:text"`
|
||||
Ratio string `json:"ratio" gorm:"size:32"`
|
||||
MediaURL string `json:"mediaUrl" gorm:"size:500"`
|
||||
OwnerID string `json:"ownerId" gorm:"size:36;index"`
|
||||
Source string `json:"source" gorm:"size:16;index"`
|
||||
Enabled bool `json:"enabled" gorm:"index"`
|
||||
Visibility string `json:"visibility" gorm:"size:16;index"`
|
||||
SortWeight int `json:"sortWeight" gorm:"index"`
|
||||
CreatedAt time.Time `json:"createdAt" gorm:"index"`
|
||||
UpdatedAt time.Time `json:"updatedAt" gorm:"index"`
|
||||
}
|
||||
|
||||
// ToolFavorite 保存用户对工具的收藏关系;一个用户对同一工具只能收藏一次。
|
||||
type ToolFavorite struct {
|
||||
ID int64 `json:"id" gorm:"primaryKey;autoIncrement"`
|
||||
UserID string `json:"userId" gorm:"size:36;index;uniqueIndex:idx_tool_favorite_user_tool,priority:1"`
|
||||
ToolID int64 `json:"toolId" gorm:"index;uniqueIndex:idx_tool_favorite_user_tool,priority:2"`
|
||||
CreatedAt time.Time `json:"createdAt" gorm:"index"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user