新增客户标签库:管理员维护、员工选择
租户级标签 CRUD 与颜色预设;客户打标仅能从库中选择,设置页提供管理入口,列表筛选随标签库动态生成。
This commit is contained in:
@@ -33,6 +33,7 @@ func Migrate(db *gorm.DB) error {
|
||||
&User{},
|
||||
&Channel{},
|
||||
&Customer{},
|
||||
&CustomerTag{},
|
||||
&Session{},
|
||||
&Message{},
|
||||
&SessionEvent{},
|
||||
|
||||
@@ -63,6 +63,17 @@ type Customer struct {
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
// CustomerTag 租户级客户标签库,由管理员维护,坐席给客户打标时选择。
|
||||
type CustomerTag struct {
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
TenantID uint `gorm:"uniqueIndex:idx_tenant_tag_name;not null" json:"tenant_id"`
|
||||
Name string `gorm:"size:30;uniqueIndex:idx_tenant_tag_name;not null" json:"name"`
|
||||
Color string `gorm:"size:20" json:"color"` // 预设色键或 #hex
|
||||
SortOrder int `gorm:"default:0" json:"sort_order"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
type Session struct {
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
TenantID uint `gorm:"index;not null" json:"tenant_id"`
|
||||
|
||||
Reference in New Issue
Block a user