feat: 优化客服会话及延迟消息逻辑

This commit is contained in:
2026-04-16 15:48:26 +08:00
parent d99481cdb0
commit 9f54f95264
10 changed files with 132 additions and 116 deletions

View File

@@ -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 "未知平台"
}