88 lines
3.1 KiB
Go
88 lines
3.1 KiB
Go
package im
|
||
|
||
import (
|
||
"time"
|
||
|
||
"git.rosy.net.cn/jx-callback/globals/api"
|
||
)
|
||
|
||
const (
|
||
BaseTemplate = "您好,特殊天气或节假日可能出现骑手变少,配送延迟等情况,烦请耐心等待,售后及其他问题请联系店长,电话:"
|
||
LastTemplate = "您好,特殊天气或节假日可能出现骑手变少,配送延迟等情况,烦请耐心等待,售后及其他问题请联系店长" //兜底模板
|
||
|
||
BasePhoneNum = "18048531223"
|
||
BaseUserListKey = "userList"
|
||
BaseMsgDetailKey = "messageDetail"
|
||
)
|
||
|
||
var AutoReplyByAppID = map[int]string{
|
||
589: "QPMenQQVcXBZ4vbwAw6jJBHVBCB2jQCGOfR5yI1cSRbdvc6VMEW9G/zCvTY7YOeCeKuo8HbB03TQHS3Y4ygGPwW40ppeJ+D1+dUeOGwy+ik=",
|
||
5873: "eCGDImGw4qAQDZPxzjVzKZUI+mRSnrPSjYo5iOVzcX3H4h1Y8F/J5SPahKARqLPDN9Ez7o46JgUMK997jTId6UVmA5VPtYjrM6Zqjlzf9EY=",
|
||
4123: "fu4TXW2odzkbvVDZZZU0gZAOw/cI+7fSU/U9NRv5Q1JQpmeLPmrdgpDxHelGijuRfM+PD+5nmV7jrHqOXxzAiJBPcU50Da014sQHH/Tn/P8=",
|
||
}
|
||
|
||
var AppSecretByAppID = map[int]string{
|
||
589: "a81eb3df418d83d6a1a4b7c572156d2f",
|
||
5873: "41c479790a76f86326f89e8048964739",
|
||
4123: "df2c88338b85f830cebce2a9eab56628",
|
||
}
|
||
|
||
// SendData 客户端写入参数
|
||
type SendData struct {
|
||
VendorID int `json:"vendorID"` // 消息来源平台ID 1-美团 3-饿了么
|
||
StoreId int `json:"storeId"` // 门店ID
|
||
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
|
||
OrderID string `json:"orderID"` //已下单才有
|
||
NewMessageNum int `json:"NewMessageNum"` //新消息数量
|
||
LatestMsg string `json:"latestMsg"` //最新一条消息
|
||
LatestTime int `json:"latestTime"` //最新一条消息发送时间
|
||
MsgFrom string `json:"msgFrom"` // 京东消息来源
|
||
}
|
||
|
||
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
|
||
}
|
||
|
||
type StoreTemplate struct {
|
||
Template string `json:"template"`
|
||
}
|
||
|
||
var (
|
||
rdb = api.Cacher
|
||
|
||
SendTypeJx = "jx" //京西客户端发送方标识
|
||
SendTypeMt = "mt" //美团用户发送方标识符
|
||
SendTypeElm = "elm" //饿了么用户发送方标识符
|
||
SendTypeJd = "jd" //京东用户发送方标识符
|
||
OpTypeAdd = 1 //门店新增或修改自定义回复模板
|
||
OpTypeGet = 2 //门店获取
|
||
BaseCusKey = "customReply"
|
||
)
|
||
|
||
const (
|
||
ExpireTimeDay = 12 * 2 * time.Hour //redis过期时间
|
||
ExpireTimeAutoReply = 20 * time.Second //redis过期时间
|
||
|
||
)
|