47 lines
1.5 KiB
Go
47 lines
1.5 KiB
Go
package jd
|
|
|
|
import (
|
|
"git.rosy.net.cn/baseapi/platformapi/dingdingapi"
|
|
"git.rosy.net.cn/baseapi/platformapi/jdapi"
|
|
"git.rosy.net.cn/baseapi/utils"
|
|
"git.rosy.net.cn/jx-callback/business/jxutils/ddmsg"
|
|
"git.rosy.net.cn/jx-callback/globals"
|
|
)
|
|
|
|
func OnOrderMsg(msg *jdapi.CallbackOrderMsg, a *jdapi.API) (retVal *jdapi.CallbackResponse) {
|
|
if CurPurchaseHandler != nil {
|
|
retVal = CurPurchaseHandler.OnOrderMsg(a, msg)
|
|
}
|
|
return retVal
|
|
}
|
|
|
|
func OnWaybillMsg(msg *jdapi.CallbackDeliveryStatusMsg) (retVal *jdapi.CallbackResponse) {
|
|
if CurPurchaseHandler != nil {
|
|
retVal = CurPurchaseHandler.OnWaybillMsg(AppKey2OrgCode(msg.AppKey), msg)
|
|
}
|
|
return retVal
|
|
}
|
|
|
|
func OnStoreMsg(msg *jdapi.CallbackOrderMsg) (retVal *jdapi.CallbackResponse) {
|
|
if CurPurchaseHandler != nil {
|
|
retVal = CurPurchaseHandler.OnStoreMsg(AppKey2OrgCode(msg.AppKey), msg)
|
|
}
|
|
return retVal
|
|
}
|
|
|
|
func OnOrderInfoChangeMsg(msg *jdapi.CallbackOrderInfoChangeMsg) (retVal *jdapi.CallbackResponse) {
|
|
if CurPurchaseHandler != nil {
|
|
retVal = CurPurchaseHandler.OnOrderInfoChangeMsg(AppKey2OrgCode(msg.AppKey), msg)
|
|
}
|
|
return retVal
|
|
}
|
|
|
|
func OnInvoiceMsg(msg *jdapi.CallbackInvoiceMsg) (retVal *jdapi.CallbackResponse) {
|
|
if CurPurchaseHandler != nil {
|
|
globals.SugarLogger.Debugf("-jd-----Invoice:= %s", utils.Format4Output(msg, false))
|
|
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, "2452A93EEB9111EC9B06525400E86DC0", "jdController发票推送", utils.Format4Output(msg, false))
|
|
retVal = CurPurchaseHandler.GetOrderInvoice(AppKey2OrgCode(msg.AppKey), msg)
|
|
}
|
|
return retVal
|
|
}
|