- 饿百售后单

- 售后单重构一下下
This commit is contained in:
gazebo
2019-05-10 18:16:13 +08:00
parent fbea78dc53
commit 068fad6253
12 changed files with 251 additions and 74 deletions

View File

@@ -1,42 +1,26 @@
package jd
import (
"errors"
"git.rosy.net.cn/baseapi/platformapi/jdapi"
"git.rosy.net.cn/baseapi/utils"
)
func OnOrderMsg(msg *jdapi.CallbackOrderMsg) (retVal *jdapi.CallbackResponse) {
if curPurchaseHandler != nil {
if retVal = curPurchaseHandler.OnOrderMsg(msg); retVal == nil {
retVal = jdapi.Err2CallbackResponse(errors.New("Internal Error"), "")
}
retVal = curPurchaseHandler.OnOrderMsg(msg)
}
return retVal
}
func OnWaybillMsg(msg *jdapi.CallbackDeliveryStatusMsg) (retVal *jdapi.CallbackResponse) {
if curPurchaseHandler != nil {
if retVal = curPurchaseHandler.OnWaybillMsg(msg); retVal == nil {
retVal = jdapi.Err2CallbackResponse(errors.New("Internal Error"), "")
}
retVal = curPurchaseHandler.OnWaybillMsg(msg)
}
return retVal
}
func OnStoreMsg(msg *jdapi.CallbackOrderMsg) (retVal *jdapi.CallbackResponse) {
if curPurchaseHandler != nil {
retVal = curPurchaseHandler.onStoreMsg(msg)
}
return retVal
}
func OnFinancialMsg2(msg *jdapi.CallbackOrderMsg) (retVal *jdapi.CallbackResponse) {
if curPurchaseHandler != nil {
utils.CallFuncAsync(func() {
OnFinancialMsg(msg)
})
retVal = curPurchaseHandler.OnStoreMsg(msg)
}
return retVal
}