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 "未知平台"
|
||||
}
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
package account
|
||||
|
||||
import "github.com/gogf/gf/v2/util/gconv"
|
||||
|
||||
var (
|
||||
VectorStatusPending = newVectorStatus(gconv.PtrInt8(1), "pending")
|
||||
VectorStatusProcessing = newVectorStatus(gconv.PtrInt8(2), "processing")
|
||||
VectorStatusCompleted = newVectorStatus(gconv.PtrInt8(3), "completed")
|
||||
VectorStatusFailed = newVectorStatus(gconv.PtrInt8(4), "failed")
|
||||
)
|
||||
|
||||
type VectorStatus *int8
|
||||
|
||||
type vectorStatus struct {
|
||||
code VectorStatus
|
||||
desc string
|
||||
}
|
||||
|
||||
func (s vectorStatus) Code() VectorStatus {
|
||||
return s.code
|
||||
}
|
||||
func (s vectorStatus) Desc() string {
|
||||
return s.desc
|
||||
}
|
||||
|
||||
func newVectorStatus(code VectorStatus, desc string) vectorStatus {
|
||||
return vectorStatus{code: code, desc: desc}
|
||||
}
|
||||
Reference in New Issue
Block a user