feat: 优化客服会话及延迟消息逻辑
This commit is contained in:
@@ -6,11 +6,6 @@ var (
|
||||
PlatformXHS = newPlatform(gconv.PtrString("xiaohongshu"), "小红书")
|
||||
PlatformDY = newPlatform(gconv.PtrString("douyin"), "抖音")
|
||||
PlatformKS = newPlatform(gconv.PtrString("kuaishou"), "快手")
|
||||
platformMap = map[Platform]platform{
|
||||
gconv.PtrString("xiaohongshu"): PlatformXHS,
|
||||
gconv.PtrString("douyin"): PlatformDY,
|
||||
gconv.PtrString("kuaishou"): PlatformKS,
|
||||
}
|
||||
)
|
||||
|
||||
type Platform *string
|
||||
@@ -32,8 +27,13 @@ func newPlatform(code Platform, desc string) platform {
|
||||
}
|
||||
|
||||
func GetDescByCode(code Platform) string {
|
||||
if p, ok := platformMap[code]; ok {
|
||||
return p.Desc()
|
||||
switch *code {
|
||||
case *PlatformXHS.Code():
|
||||
return PlatformXHS.Desc()
|
||||
case *PlatformDY.Code():
|
||||
return PlatformDY.Desc()
|
||||
case *PlatformKS.Code():
|
||||
return PlatformKS.Desc()
|
||||
}
|
||||
return "未知平台"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user