fix: update CustomerSourceTypeWebChat to use ExternalSourceGuest and adjust related mappings
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -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))
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user