166 lines
6.2 KiB
Go
166 lines
6.2 KiB
Go
package jdapi
|
||
|
||
type ContextFrom struct {
|
||
Pin string `json:"pin"` // 发送消息的账号,从接收消息MQ里面取
|
||
App string `json:"app"` // im.waiter 固定值
|
||
ClientType string `json:"clientType"` // gw 固定值
|
||
}
|
||
|
||
type ContextTo struct {
|
||
Pin string `json:"pin"` // 消息接收者的账号, 从接收消息MQ里面取
|
||
App string `json:"app"` // im.customer 固定值
|
||
}
|
||
|
||
// ContextMsg 消息发送接口 - 向用户发送在线消息
|
||
type ContextMsg struct {
|
||
Id string `json:"id"` // uuid 随机生成字符串
|
||
Lang string `json:"lang"` // 固定值 zh_CN
|
||
Type string `json:"type"` // 固定值 chat_message
|
||
From ContextFrom `json:"from"`
|
||
To ContextTo `json:"to"`
|
||
Body ContextBody `json:"body"`
|
||
Timestamp int64 `json:"timestamp"`
|
||
ClientTime int64 `json:"clientTime"`
|
||
}
|
||
|
||
type ContextBody struct {
|
||
Type string `json:"type"` // 消息类型,根据需求场景
|
||
Content string `json:"content"` // 字符型,必须。文本消息内容。
|
||
Chatinfo ContextBodyChatInfo `json:"chatinfo"`
|
||
Template struct {
|
||
Source string `json:"source"` // dd_msg_产品线标识_消息标识“ 卡片类消息必传
|
||
} `json:"template"`
|
||
Mt int `json:"mt"`
|
||
}
|
||
type ContextBodyChatInfo struct {
|
||
VenderId string `json:"venderId"` // 服务商id,从接收消息MQ里面取
|
||
AskAllocateType string `json:"askAllocateType"` // multiChat 固定值
|
||
Sid string `json:"sid"` // 从接收消息MQ里面取
|
||
Source string `json:"source"` // dd_msg_产品线标识_消息标识“ 必传
|
||
}
|
||
|
||
type BaseInfo struct {
|
||
AppKey string `json:"app_key"`
|
||
Token string `json:"token"`
|
||
Timestamp string `json:"timestamp"`
|
||
Sign string `json:"sign"`
|
||
Format string `json:"format"`
|
||
V string `json:"v"`
|
||
JdParamJson string `json:"jd_param_json"`
|
||
}
|
||
|
||
type JdParamJsonObj struct {
|
||
StatusId string `json:"statusId"` // 由于推送消息不含有次参数,存储的为jxid
|
||
BillId string `json:"billId"` // 由于推送消息不含有次参数,存储的为平台id320406
|
||
ExtendJsonData string `json:"extendJsonData"`
|
||
StoreId string `json:"storeId"`
|
||
Timestamp string `json:"timestamp"`
|
||
}
|
||
|
||
type ChatRisInfo struct {
|
||
RiskType int `json:"riskType"` // 风控类型:1: 风控平台, 2: 商家自己设置敏感词, 3: 开放平台
|
||
RiskCode string `json:"riskCode"` // 风控文案
|
||
From struct {
|
||
App string `json:"app"`
|
||
Art string `json:"art"`
|
||
ClientType string `json:"clientType"`
|
||
Pin string `json:"pin"`
|
||
} `json:"from"` // 发送方消息
|
||
To struct {
|
||
App string `json:"app"`
|
||
Pin string `json:"pin"`
|
||
} `json:"to"` // 接收方消息
|
||
Type string `json:"type"` // 消息类型
|
||
Body interface{} `json:"body"` // 消息信息
|
||
Timestamp int64 `json:"timestamp"` // 时间
|
||
Sid string `json:"sid"` // 客服咨询业务的会话ID[与接收的消息体里面的sid关联,属于同一会话]
|
||
Id string `json:"id"` // 咚咚聊天消息唯一ID[即chat_message消息体内的id字段]
|
||
}
|
||
|
||
// UserChatMsg 用户消息推送
|
||
type UserChatMsg struct {
|
||
Id string `json:"id"` // 咚咚聊天消息唯一ID[即chat_message消息体内的id字段]
|
||
Lang string `json:"lang"` // 语言类型
|
||
Type string `json:"type"`
|
||
From struct {
|
||
Pin string `json:"pin"` // 发送消息的账号
|
||
App string `json:"app"` // 发送消息的app
|
||
ClientType string `json:"clientType"` // 发送消息终端
|
||
} `json:"from"`
|
||
To struct {
|
||
Pin string `json:"pin"` // 消息接收者的账号
|
||
App string `json:"app"` // 接收消息的app
|
||
ClientType string `json:"clientType"` // 接收消息的终端"
|
||
} `json:"to"`
|
||
Body UserChatMsgBody `json:"body"`
|
||
Timestamp int64 `json:"timestamp"`
|
||
ClientTime int64 `json:"clientTime"`
|
||
}
|
||
|
||
type UserChatMsgBody struct {
|
||
Chatinfo struct {
|
||
IMService bool `json:"IMService"`
|
||
AppId string `json:"appId"`
|
||
AskAllocateType string `json:"askAllocateType"`
|
||
AskType string `json:"askType"`
|
||
DdSessionType string `json:"ddSessionType"`
|
||
DeviceNo string `json:"deviceNo"`
|
||
DisputeId int `json:"disputeId"`
|
||
DistinguishPersonJimi int `json:"distinguishPersonJimi"`
|
||
Eidtoken string `json:"eidtoken"`
|
||
Entry string `json:"entry"`
|
||
FirstMsg bool `json:"firstMsg"`
|
||
IsJdSuperMarket string `json:"isJdSuperMarket"`
|
||
Label int `json:"label"`
|
||
LeaveMsgTable int `json:"leaveMsgTable"`
|
||
OGroupId int `json:"oGroupId"`
|
||
OSid string `json:"oSid"`
|
||
ProVer string `json:"proVer"`
|
||
Region string `json:"region"`
|
||
RepeatConsult int `json:"repeatConsult"`
|
||
RepeatHuman int `json:"repeatHuman"`
|
||
Sid string `json:"sid"`
|
||
Source string `json:"source"`
|
||
StoreId string `json:"storeId"`
|
||
SystemVer string `json:"systemVer"`
|
||
VenderId string `json:"venderId"`
|
||
VenderName string `json:"venderName"`
|
||
Verification string `json:"verification"`
|
||
} `json:"chatinfo"`
|
||
Content string `json:"content"`
|
||
LlmStream int `json:"llmStream"`
|
||
Param struct {
|
||
Ref string `json:"$ref"`
|
||
} `json:"param"`
|
||
RequestData struct {
|
||
Entry string `json:"entry"`
|
||
VenderId string `json:"venderId"`
|
||
} `json:"requestData"`
|
||
Sid string `json:"sid"`
|
||
Thumbnail string `json:"thumbnail"`
|
||
Type string `json:"type"`
|
||
}
|
||
|
||
// UserMsgReadAck 已读消息推送
|
||
type UserMsgReadAck struct {
|
||
Timestamp int64 `json:"timestamp"`
|
||
To struct {
|
||
App string `json:"app"`
|
||
Pin string `json:"pin"`
|
||
} `json:"to"`
|
||
Body interface{} `json:"body"`
|
||
From struct {
|
||
App string `json:"app"`
|
||
Pin string `json:"pin"`
|
||
} `json:"from"`
|
||
Datetime int64 `json:"datetime"`
|
||
Type string `json:"type"`
|
||
}
|
||
|
||
// JxSendData 京西回复京东用户消息
|
||
type JxSendData struct {
|
||
FromPin string `json:"from_pin"`
|
||
ToPin string `json:"to_pin"`
|
||
Content string `json:"content"`
|
||
}
|