实现租户系统设置落库:欢迎语、工作时间与通知开关
- 新增 TenantSetting 模型与 /api/settings 读写接口 - 设置页接通基本资料、自动回复、工作时间、通知偏好 - Widget 初始化使用欢迎语/离线提示,非工作时间不自动分配 - 补充设置持久化与 Widget 提示集成测试
This commit is contained in:
@@ -152,3 +152,21 @@ type Announcement struct {
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
// TenantSetting 租户级系统设置(欢迎语、工作时间、通知开关等)。
|
||||
type TenantSetting struct {
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
TenantID uint `gorm:"uniqueIndex;not null" json:"tenant_id"`
|
||||
DisplayName string `gorm:"size:100" json:"display_name"`
|
||||
AgentNickname string `gorm:"size:50" json:"agent_nickname"`
|
||||
Timezone string `gorm:"size:50;default:Asia/Shanghai" json:"timezone"`
|
||||
WelcomeMessage string `gorm:"size:500" json:"welcome_message"`
|
||||
OfflinePrompt string `gorm:"size:500" json:"offline_prompt"`
|
||||
WorkHoursJSON string `gorm:"type:text" json:"work_hours_json"`
|
||||
WorktimePrompt string `gorm:"size:500" json:"worktime_prompt"`
|
||||
NotifyNewSession bool `gorm:"default:true" json:"notify_new_session"`
|
||||
NotifyOfflineLeave bool `gorm:"default:true" json:"notify_offline_leave"`
|
||||
NotifyDailyReport bool `gorm:"default:false" json:"notify_daily_report"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user