This commit is contained in:
richboo111
2023-09-05 15:23:09 +08:00
parent 6ca2fcbda0
commit ef9c37ac1b
5 changed files with 3 additions and 3 deletions

View File

@@ -0,0 +1,55 @@
package im
import (
"time"
"git.rosy.net.cn/jx-callback/globals/api"
)
// SendData 客户端写入参数
type SendData struct {
VendorID int `json:"vendorID"` //消息来源平台ID 1-美团 3-饿了么
Data interface{} `json:"data"` //发送给平台 美团/饿了么消息结构体
}
// JXMsg 京西消息结构体
type JXMsg struct {
SendType string `json:"sendType"` //消息发送方 jx-商家mt-美团elm-饿了么
MsgContent interface{} `json:"msgContent"` //美团/饿了么 单聊消息
}
// UserMessageList 用户消息列表
type UserMessageList struct {
VendorID int `json:"vendorID"` //平台品牌 1-美团 3-饿了么
UserID string `json:"userID"` //用户ID
NewMessageNum int `json:"NewMessageNum"` //新消息数量
LatestMsg string `json:"latestMsg"` //最新一条消息
LatestTime int `json:"latestTime"` //最新一条消息发送时间
}
type RelInfo struct {
VendorStoreID string `json:"vendorStoreID"` //平台门店id
VendorID string `json:"vendorID"` //平台标识id
AppID string `json:"appID"` //应用ID
}
type UserRelInfo struct {
VendorStoreID string `json:"vendorStoreID"` //平台门店id
VendorID string `json:"vendorID"` //平台标识id
AppID string `json:"appID"` //应用ID
UserID string `json:"userID"` //用户id/groupID
}
var (
rdb = api.Cacher
VendorIDMT = 1 //im美团
VendorIDELM = 3 //im饿了么
SendTypeJx = "jx" //京西客户端发送方标识
SendTypeMt = "mt" //美团用户发送方标识符
SendTypeElm = "elm" //饿了么用户发送方标识符
)
const (
ExpireTimeDay = 6 * time.Hour //redis过期时间
)