51 lines
1.3 KiB
Go
51 lines
1.3 KiB
Go
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"
|
|
)
|
|
|
|
type FnController struct {
|
|
web.Controller
|
|
}
|
|
|
|
func (c *FnController) Msg() {
|
|
//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()
|
|
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")
|
|
//}
|
|
}
|