refactor(chat): 欢迎语仅保留账号群配置

This commit is contained in:
yml2213
2026-10-30 17:50:37 +08:00
parent 77b5c6123a
commit 0a85634a58
18 changed files with 29 additions and 236 deletions
@@ -11,8 +11,6 @@ import (
)
const (
autoWelcomeConfigKey = "chat.auto_welcome_message"
defaultAutoWelcomeMessage = "欢迎加入订单群聊!如有任何问题,请随时沟通。"
listingGroupWelcomeConfigKey = "chat.listing_group_welcome"
defaultListingGroupWelcome = "欢迎加入账号群!请号主扫描下方二维码加入企业微信群,方便客服与您及时联系。"
)
@@ -104,19 +102,6 @@ func (r *Repository) DeleteQuickReply(ctx context.Context, adminID uint64, reply
return r.db.WithContext(ctx).Where("id = ? AND admin_user_id = ?", replyID, adminID).
Delete(&model.ChatQuickReply{}).Error
}
func (r *Repository) GetAutoWelcomeMessage(ctx context.Context) string {
var cfg model.SystemConfig
if err := r.db.WithContext(ctx).Where("`key` = ?", autoWelcomeConfigKey).First(&cfg).Error; err != nil {
return defaultAutoWelcomeMessage
}
return cfg.Value
}
func (r *Repository) UpdateAutoWelcomeMessage(ctx context.Context, message string) error {
return r.db.WithContext(ctx).Model(&model.SystemConfig{}).
Where("`key` = ?", autoWelcomeConfigKey).
Update("value", message).Error
}
func (r *Repository) GetListingGroupWelcomeMessage(ctx context.Context) string {
var cfg model.SystemConfig
if err := r.db.WithContext(ctx).Where("`key` = ?", listingGroupWelcomeConfigKey).First(&cfg).Error; err != nil {