2026-04-09 10:01:23 +08:00
|
|
|
package enums
|
|
|
|
|
|
2026-04-27 18:42:04 +08:00
|
|
|
const CustomerSourceTypeWebChat = ExternalSourceGuest
|
2026-04-09 10:01:23 +08:00
|
|
|
|
2026-04-14 12:14:13 +08:00
|
|
|
func GetCustomerSourceTypeLabel(sourceType ExternalSource) string {
|
2026-04-09 10:01:23 +08:00
|
|
|
return GetExternalSourceLabel(ExternalSource(sourceType))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 联系方式类型
|
|
|
|
|
type ContactType string
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
ContactTypeMobile ContactType = "mobile"
|
|
|
|
|
ContactTypeEmail ContactType = "email"
|
|
|
|
|
ContactTypeWeChat ContactType = "wechat"
|
|
|
|
|
ContactTypeOther ContactType = "other"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
var contactTypeLabelMap = map[ContactType]string{
|
|
|
|
|
ContactTypeMobile: "手机号",
|
|
|
|
|
ContactTypeEmail: "邮箱",
|
|
|
|
|
ContactTypeOther: "其他",
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func GetContactTypeLabel(contactType ContactType) string {
|
|
|
|
|
return contactTypeLabelMap[contactType]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// IsValidContactType 判断字符串是否为合法联系方式类型。
|
|
|
|
|
func IsValidContactType(v string) bool {
|
|
|
|
|
switch ContactType(v) {
|
|
|
|
|
case ContactTypeMobile, ContactTypeEmail, ContactTypeWeChat, ContactTypeOther:
|
|
|
|
|
return true
|
|
|
|
|
default:
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
}
|