From 0380ed93debefbf8ed2705566f578bc56c68d06b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Wed, 30 Mar 2022 17:34:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E8=B0=83=E6=89=93=E6=A1=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/fn_callback.go | 61 ++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/controllers/fn_callback.go b/controllers/fn_callback.go index 4a86376b6..3fef7c05b 100644 --- a/controllers/fn_callback.go +++ b/controllers/fn_callback.go @@ -1,11 +1,11 @@ package controllers import ( + "fmt" "git.rosy.net.cn/baseapi/platformapi/fnpsapi" "git.rosy.net.cn/jx-callback/business/partner/delivery/fn" "git.rosy.net.cn/jx-callback/globals/api" "github.com/astaxie/beego/server/web" - "net/http" ) type FnController struct { @@ -13,35 +13,38 @@ type FnController struct { } func (c *FnController) Msg() { - if c.Ctx.Input.Method() == http.MethodPost { - msg, callbackResponse := api.FnAPI.GetChainstoreStatusNotify(c.Ctx.Request) - if callbackResponse.Code != 1 { - c.Data["json"] = callbackResponse - c.ServeJSON() - return - } - - switch msg["callback_business_type"] { - case fnpsapi.ChainstoreStatus: // 门店状态变更回调 - callbackResponse = fn.OnStoreStatus(msg) - break - case fnpsapi.AbnormalStatus: // 异常报备回调 - case fnpsapi.CookingFinishStatus: // 商户出餐回调 - break - case fnpsapi.ChainstoreServiceStatus: // 门店采购服务变更回调 - break - case fnpsapi.NoServiceStatus: // 城市屏蔽区域调整回调通知 - break - case fnpsapi.OrderStatus: // 订单状态回调 - fn.OnWaybillMsg(msg) - break - default: - break - } - + //if c.Ctx.Input.Method() == http.MethodPost { + fmt.Println("开始回调==========================") + msg, callbackResponse := api.FnAPI.GetChainstoreStatusNotify(c.Ctx.Request) + fmt.Println("开始回调==========================msg", msg) + fmt.Println("开始回调==========================callbackResponse", callbackResponse) + if callbackResponse.Code != 1 { c.Data["json"] = callbackResponse c.ServeJSON() - } else { - c.Abort("404") + return } + + switch msg["callback_business_type"] { + case fnpsapi.ChainstoreStatus: // 门店状态变更回调 + callbackResponse = fn.OnStoreStatus(msg) + break + case fnpsapi.AbnormalStatus: // 异常报备回调 + case fnpsapi.CookingFinishStatus: // 商户出餐回调 + break + case fnpsapi.ChainstoreServiceStatus: // 门店采购服务变更回调 + break + case fnpsapi.NoServiceStatus: // 城市屏蔽区域调整回调通知 + break + case fnpsapi.OrderStatus: // 订单状态回调 + fn.OnWaybillMsg(msg) + break + default: + break + } + + c.Data["json"] = callbackResponse + c.ServeJSON() + //} else { + c.Abort("404") + //} }