新增独立快捷回复模块(团队/个人)
从知识库拆出快捷回复:支持团队暂存与发布同步、个人话术、输入码与工作台 / 调用,以及 CSV 导入导出;管理页顶栏与侧栏对齐。
This commit is contained in:
@@ -38,6 +38,7 @@ func Migrate(db *gorm.DB) error {
|
||||
&SessionEvent{},
|
||||
&Category{},
|
||||
&KnowledgeEntry{},
|
||||
&QuickReply{},
|
||||
&Plan{},
|
||||
&OperationLog{},
|
||||
&Announcement{},
|
||||
|
||||
@@ -123,6 +123,24 @@ type KnowledgeEntry struct {
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
// QuickReply 团队/个人快捷回复(与知识库独立)。
|
||||
// Scope=team 时 OwnerUserID 为空,全租户共享;Scope=personal 时归属 OwnerUserID。
|
||||
type QuickReply struct {
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
TenantID uint `gorm:"index;not null" json:"tenant_id"`
|
||||
Scope string `gorm:"size:20;index;not null" json:"scope"` // team | personal
|
||||
OwnerUserID *uint `gorm:"index" json:"owner_user_id,omitempty"`
|
||||
Title string `gorm:"size:100;not null" json:"title"`
|
||||
Content string `gorm:"type:text;not null" json:"content"`
|
||||
Shortcut string `gorm:"size:32;index" json:"shortcut"` // 输入码,如 nh → /nh
|
||||
GroupName string `gorm:"size:50" json:"group_name"`
|
||||
Status string `gorm:"size:20;default:draft;index" json:"status"` // draft | published
|
||||
SortOrder int `gorm:"default:0" json:"sort_order"`
|
||||
UsageCount int `gorm:"default:0" json:"usage_count"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
type Plan struct {
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
Name string `gorm:"size:30;not null" json:"name"`
|
||||
|
||||
Reference in New Issue
Block a user