新增客户标签库:管理员维护、员工选择

租户级标签 CRUD 与颜色预设;客户打标仅能从库中选择,设置页提供管理入口,列表筛选随标签库动态生成。
This commit is contained in:
yml2213
2026-07-17 22:28:16 +08:00
parent c5f28dca1c
commit 7a08f5f729
11 changed files with 723 additions and 23 deletions
+11
View File
@@ -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"`