美团配送回调

This commit is contained in:
邹宗楠
2022-03-15 17:22:26 +08:00
parent 8ec2350757
commit 88783fa086
2 changed files with 7 additions and 25 deletions

View File

@@ -6,31 +6,6 @@ import (
"git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/model"
) )
//
//if msg.Cmd == mtwmapi.MsgTypeStoreStatusChanged || msg.Cmd == mtwmapi.MsgTypeStoreAuditStatusChanged {
//response = CurPurchaseHandler.onStoreStatusChanged(msg)
//} else if msg.Cmd == mtwmapi.MsgTypePrivateNumberDowngrade {
//response = CurPurchaseHandler.onNumberDowngrade(msg)
//} else if msg.Cmd == mtwmapi.MsgTypeStoreBind {
//
//} else {
//if orderID := GetOrderIDFromMsg(msg); orderID != "" {
//jxutils.CallMsgHandler(func() {
//switch msg.Cmd {
//case mtwmapi.MsgTypeWaybillStatus:
//response = CurPurchaseHandler.onWaybillMsg(msg)
//default:
//response = CurPurchaseHandler.onOrderMsg(msg)
//}
//}, jxutils.ComposeUniversalOrderID(orderID, model.VendorIDMTWM))
//}
///*if msg.Cmd == mtwmapi.MsgTypeOrderRefund || msg.Cmd == mtwmapi.MsgTypeOrderPartialRefund {
// utils.CallFuncAsync(func() {
// OnFinancialMsg(msg)
// })
//} */
//}
func OnCallbackMsg(msg *mtwmapi.CallbackMsg) (response *mtwmapi.CallbackResponse) { func OnCallbackMsg(msg *mtwmapi.CallbackMsg) (response *mtwmapi.CallbackResponse) {
if CurPurchaseHandler == nil { if CurPurchaseHandler == nil {
return &mtwmapi.CallbackResponse{Data: "CurPurchaseHandler init fail"} return &mtwmapi.CallbackResponse{Data: "CurPurchaseHandler init fail"}

View File

@@ -2,7 +2,9 @@ package controllers
import ( import (
"git.rosy.net.cn/baseapi/platformapi/mtwmapi" "git.rosy.net.cn/baseapi/platformapi/mtwmapi"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/partner/purchase/mtwm" "git.rosy.net.cn/jx-callback/business/partner/purchase/mtwm"
"git.rosy.net.cn/jx-callback/globals"
"git.rosy.net.cn/jx-callback/globals/api" "git.rosy.net.cn/jx-callback/globals/api"
"github.com/astaxie/beego/server/web" "github.com/astaxie/beego/server/web"
) )
@@ -12,9 +14,14 @@ type MtwmController struct {
} }
func (c *MtwmController) onCallbackMsg(msgType string) { func (c *MtwmController) onCallbackMsg(msgType string) {
c.Data["json"] = mtwmapi.Err2CallbackResponse(nil, "")
msg, callbackResponse := api.MtwmAPI.GetCallbackMsg(c.Ctx.Request) msg, callbackResponse := api.MtwmAPI.GetCallbackMsg(c.Ctx.Request)
globals.SugarLogger.Debug(utils.Format4Output(msg, true))
if callbackResponse == nil { if callbackResponse == nil {
callbackResponse = mtwm.OnCallbackMsg(msg) callbackResponse = mtwm.OnCallbackMsg(msg)
if callbackResponse == nil {
callbackResponse = mtwmapi.Err2CallbackResponse(nil, "")
}
} }
c.Data["json"] = callbackResponse c.Data["json"] = callbackResponse
c.ServeJSON() c.ServeJSON()