|
|
|
@@ -39,12 +39,25 @@ const (
|
|
|
|
|
EventTypeXpayGoodsDeliverNotify EventType = "xpay_goods_deliver_notify"
|
|
|
|
|
// EventTypeXpayCoinPayNotify 代币支付推送事件
|
|
|
|
|
EventTypeXpayCoinPayNotify EventType = "xpay_coin_pay_notify"
|
|
|
|
|
// EventSubscribePopup 用户操作订阅通知弹窗事件推送,用户在图文等场景内订阅通知的操作
|
|
|
|
|
EventSubscribePopup EventType = "subscribe_msg_popup_event"
|
|
|
|
|
// EventSubscribeMsgChange 用户管理订阅通知,用户在服务通知管理页面做通知管理时的操作
|
|
|
|
|
EventSubscribeMsgChange EventType = "subscribe_msg_change_event"
|
|
|
|
|
// EventSubscribeMsgSent 发送订阅通知,调用 bizsend 接口发送通知
|
|
|
|
|
EventSubscribeMsgSent EventType = "subscribe_msg_sent_event"
|
|
|
|
|
// ConfirmReceiveMethodAuto 自动确认收货
|
|
|
|
|
ConfirmReceiveMethodAuto ConfirmReceiveMethod = 1
|
|
|
|
|
// ConfirmReceiveMethodManual 手动确认收货
|
|
|
|
|
ConfirmReceiveMethodManual ConfirmReceiveMethod = 2
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
// InfoTypeAcceptSubscribeMessage 接受订阅通知
|
|
|
|
|
InfoTypeAcceptSubscribeMessage InfoType = "accept"
|
|
|
|
|
// InfoTypeRejectSubscribeMessage 拒绝订阅通知
|
|
|
|
|
InfoTypeRejectSubscribeMessage InfoType = "reject"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// PushReceiver 接收消息推送
|
|
|
|
|
// 暂仅支付 Aes 加密方式
|
|
|
|
|
type PushReceiver struct {
|
|
|
|
@@ -188,6 +201,21 @@ func (receiver *PushReceiver) getEvent(dataType string, eventType EventType, dec
|
|
|
|
|
var pushData PushDataXpayCoinPayNotify
|
|
|
|
|
err := receiver.unmarshal(dataType, decryptMsg, &pushData)
|
|
|
|
|
return &pushData, err
|
|
|
|
|
case EventSubscribePopup:
|
|
|
|
|
// 用户操作订阅通知弹窗事件推送
|
|
|
|
|
var pushData PushDataSubscribePopup
|
|
|
|
|
err := receiver.unmarshal(dataType, decryptMsg, &pushData)
|
|
|
|
|
return &pushData, err
|
|
|
|
|
case EventSubscribeMsgChange:
|
|
|
|
|
// 用户管理订阅通知事件推送
|
|
|
|
|
var pushData PushDataSubscribeMsgChange
|
|
|
|
|
err := receiver.unmarshal(dataType, decryptMsg, &pushData)
|
|
|
|
|
return &pushData, err
|
|
|
|
|
case EventSubscribeMsgSent:
|
|
|
|
|
// 用户发送订阅通知事件推送
|
|
|
|
|
var pushData PushDataSubscribeMsgSent
|
|
|
|
|
err := receiver.unmarshal(dataType, decryptMsg, &pushData)
|
|
|
|
|
return &pushData, err
|
|
|
|
|
}
|
|
|
|
|
// 暂不支持其他事件类型,直接返回解密后的数据,由调用方处理
|
|
|
|
|
return decryptMsg, nil
|
|
|
|
@@ -306,8 +334,8 @@ type PushDataSecVodUpload struct {
|
|
|
|
|
type SecVodUploadEvent struct {
|
|
|
|
|
MediaID string `json:"media_id" xml:"media_id"` // 媒资 id
|
|
|
|
|
SourceContext string `json:"source_context" xml:"source_context"` // 透传上传接口中开发者设置的值。
|
|
|
|
|
Errcode int `json:"errcode" xml:"errcode"` // 错误码,上传失败时该值非
|
|
|
|
|
Errmsg string `json:"errmsg" xml:"errmsg"` // 错误提示
|
|
|
|
|
ErrCode int `json:"errcode" xml:"errcode"` // 错误码,上传失败时该值非
|
|
|
|
|
ErrMsg string `json:"errmsg" xml:"errmsg"` // 错误提示
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PushDataSecVodAudit 短剧媒资审核状态
|
|
|
|
@@ -373,3 +401,46 @@ type CoinInfo struct {
|
|
|
|
|
ActualPrice int64 `json:"ActualPrice" xml:"ActualPrice"` // 物品实际支付价格(单位:分)
|
|
|
|
|
Attach string `json:"Attach" xml:"Attach"` // 透传信息
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PushDataSubscribePopup 用户操作订阅通知弹窗事件推送
|
|
|
|
|
type PushDataSubscribePopup struct {
|
|
|
|
|
CommonPushData
|
|
|
|
|
SubscribeMsgPopupEvent SubscribeMsgPopupEvent `json:"-" xml:"SubscribeMsgPopup"` // 用户操作订阅通知弹窗消息回调
|
|
|
|
|
List []SubscribeMessageList `xml:"SubscribeMsgPopup>List" json:"List"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SubscribeMsgPopupEvent 用户操作订阅通知弹窗消息回调
|
|
|
|
|
type SubscribeMsgPopupEvent struct {
|
|
|
|
|
List []SubscribeMessageList `xml:"List" json:"List"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PushDataSubscribeMsgChange 用户管理订阅通知事件推送
|
|
|
|
|
type PushDataSubscribeMsgChange struct {
|
|
|
|
|
CommonPushData
|
|
|
|
|
SubscribeMsgChangeEvent SubscribeMsgChangeEvent `json:"-" xml:"SubscribeMsgChangeEvent"` // 用户管理订阅通知回调
|
|
|
|
|
List []SubscribeMessageList `xml:"SubscribeMsgChangeEvent>List" json:"List"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SubscribeMsgChangeEvent 用户管理订阅通知回调
|
|
|
|
|
type SubscribeMsgChangeEvent struct {
|
|
|
|
|
List []SubscribeMessageList `xml:"List" json:"List"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PushDataSubscribeMsgSent 用户发送订阅通知事件推送
|
|
|
|
|
type PushDataSubscribeMsgSent struct {
|
|
|
|
|
CommonPushData
|
|
|
|
|
SubscribeMsgSentEvent SubscribeMsgSentEvent `json:"-" xml:"SubscribeMsgSentEvent"` // 用户发送订阅通知回调
|
|
|
|
|
List []SubscribeMessageList `xml:"SubscribeMsgSentEvent>List" json:"List"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SubscribeMsgSentEvent 用户发送订阅通知回调
|
|
|
|
|
type SubscribeMsgSentEvent struct {
|
|
|
|
|
List []SubscribeMessageList `xml:"List" json:"List"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SubscribeMessageList 订阅消息事件列表
|
|
|
|
|
type SubscribeMessageList struct {
|
|
|
|
|
TemplateID string `xml:"TemplateId" json:"TemplateId"`
|
|
|
|
|
SubscribeStatusString string `xml:"SubscribeStatusString" json:"SubscribeStatusString"`
|
|
|
|
|
PopupScene string `xml:"PopupScene" json:"PopupScene"`
|
|
|
|
|
}
|
|
|
|
|