refactor: remove welcomeText field from WebChannelConfig and related components
This commit is contained in:
@@ -24,13 +24,12 @@ func (c *ImWidgetController) AnyConfig() *web.JsonResult {
|
||||
}
|
||||
|
||||
ret := response.WidgetConfigResponse{
|
||||
ChannelID: channel.ChannelID,
|
||||
Title: cfg.Title,
|
||||
Subtitle: cfg.Subtitle,
|
||||
WelcomeText: cfg.WelcomeText,
|
||||
ThemeColor: cfg.ThemeColor,
|
||||
Position: cfg.Position,
|
||||
Width: cfg.Width,
|
||||
ChannelID: channel.ChannelID,
|
||||
Title: cfg.Title,
|
||||
Subtitle: cfg.Subtitle,
|
||||
ThemeColor: cfg.ThemeColor,
|
||||
Position: cfg.Position,
|
||||
Width: cfg.Width,
|
||||
}
|
||||
return web.JsonData(ret)
|
||||
}
|
||||
|
||||
@@ -17,10 +17,9 @@ type WxWorkKFChannelConfig struct {
|
||||
}
|
||||
|
||||
type WebChannelConfig struct {
|
||||
Title string `json:"title"`
|
||||
Subtitle string `json:"subtitle"`
|
||||
WelcomeText string `json:"welcomeText"`
|
||||
ThemeColor string `json:"themeColor"`
|
||||
Position string `json:"position"`
|
||||
Width string `json:"width"`
|
||||
Title string `json:"title"`
|
||||
Subtitle string `json:"subtitle"`
|
||||
ThemeColor string `json:"themeColor"`
|
||||
Position string `json:"position"`
|
||||
Width string `json:"width"`
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package response
|
||||
|
||||
type WidgetConfigResponse struct {
|
||||
ChannelID string `json:"channelId"`
|
||||
Title string `json:"title"`
|
||||
Subtitle string `json:"subtitle"`
|
||||
WelcomeText string `json:"welcomeText"`
|
||||
ThemeColor string `json:"themeColor"`
|
||||
Position string `json:"position"`
|
||||
Width string `json:"width"`
|
||||
ChannelID string `json:"channelId"`
|
||||
Title string `json:"title"`
|
||||
Subtitle string `json:"subtitle"`
|
||||
ThemeColor string `json:"themeColor"`
|
||||
Position string `json:"position"`
|
||||
Width string `json:"width"`
|
||||
}
|
||||
|
||||
@@ -162,12 +162,11 @@ func (s *channelService) ParseWxWorkKFChannelConfig(raw string) (*dto.WxWorkKFCh
|
||||
func (s *channelService) ParseWebChannelConfig(raw string) (*dto.WebChannelConfig, error) {
|
||||
raw = strings.TrimSpace(raw)
|
||||
cfg := &dto.WebChannelConfig{
|
||||
Title: "在线客服",
|
||||
Subtitle: "欢迎咨询",
|
||||
WelcomeText: "",
|
||||
ThemeColor: "#2563eb",
|
||||
Position: "right",
|
||||
Width: "380px",
|
||||
Title: "在线客服",
|
||||
Subtitle: "欢迎咨询",
|
||||
ThemeColor: "#2563eb",
|
||||
Position: "right",
|
||||
Width: "380px",
|
||||
}
|
||||
if raw != "" {
|
||||
if err := json.Unmarshal([]byte(raw), cfg); err != nil {
|
||||
@@ -179,7 +178,6 @@ func (s *channelService) ParseWebChannelConfig(raw string) (*dto.WebChannelConfi
|
||||
cfg.Title = "在线客服"
|
||||
}
|
||||
cfg.Subtitle = strings.TrimSpace(cfg.Subtitle)
|
||||
cfg.WelcomeText = strings.TrimSpace(cfg.WelcomeText)
|
||||
cfg.ThemeColor = strings.TrimSpace(cfg.ThemeColor)
|
||||
if cfg.ThemeColor == "" {
|
||||
cfg.ThemeColor = "#2563eb"
|
||||
|
||||
Reference in New Issue
Block a user