fix: update CustomerSourceTypeWebChat to use ExternalSourceGuest and adjust related mappings

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
mlogclub
2026-04-27 18:42:04 +08:00
parent 73b78a817d
commit 9d2abcd702
2 changed files with 4 additions and 6 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
package enums package enums
const CustomerSourceTypeWebChat = ExternalSourceWebChat const CustomerSourceTypeWebChat = ExternalSourceGuest
func GetCustomerSourceTypeLabel(sourceType ExternalSource) string { func GetCustomerSourceTypeLabel(sourceType ExternalSource) string {
return GetExternalSourceLabel(ExternalSource(sourceType)) return GetExternalSourceLabel(ExternalSource(sourceType))
+3 -5
View File
@@ -6,14 +6,12 @@ package enums
type ExternalSource string type ExternalSource string
const ( const (
ExternalSourceWebChat ExternalSource = "guest" ExternalSourceGuest ExternalSource = "guest"
ExternalSourceWechatMP ExternalSource = "wechat_mp"
ExternalSourceWxWorkKF ExternalSource = "wxwork_kf" ExternalSourceWxWorkKF ExternalSource = "wxwork_kf"
) )
var externalSourceLabelMap = map[ExternalSource]string{ var externalSourceLabelMap = map[ExternalSource]string{
ExternalSourceWebChat: "访客", ExternalSourceGuest: "访客",
ExternalSourceWechatMP: "微信公众号",
ExternalSourceWxWorkKF: "企业微信客服", ExternalSourceWxWorkKF: "企业微信客服",
} }
@@ -27,7 +25,7 @@ func GetExternalSourceLabel(v ExternalSource) string {
// IsAllowedOpenImExternalSource 开放 IM 入口允许的外部来源(闭集校验)。 // IsAllowedOpenImExternalSource 开放 IM 入口允许的外部来源(闭集校验)。
func IsAllowedOpenImExternalSource(s ExternalSource) bool { func IsAllowedOpenImExternalSource(s ExternalSource) bool {
switch s { switch s {
case ExternalSourceWebChat, ExternalSourceWechatMP: case ExternalSourceGuest:
return true return true
default: default:
return false return false