回调
This commit is contained in:
@@ -2,8 +2,6 @@ package controllers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/platformapi/fnpsapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/partner/delivery/fn"
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
"github.com/astaxie/beego/server/web"
|
||||
@@ -18,7 +16,7 @@ type FnController struct {
|
||||
func (c *FnController) FnOrderStatus() {
|
||||
if c.Ctx.Input.Method() == http.MethodPost {
|
||||
fmt.Println("开始回调订单状态==========================")
|
||||
msg, callbackResponse := api.FnAPI.GetChainstoreStatusNotify(c.Ctx.Request)
|
||||
msg, callbackResponse := api.FnAPI.GetChainOrderStatusNotify(c.Ctx.Request)
|
||||
fmt.Println("开始回调订单状态==========================msg", msg)
|
||||
fmt.Println("开始回调订单状态==========================callbackResponse", callbackResponse)
|
||||
if callbackResponse.Code != 1 {
|
||||
@@ -28,10 +26,7 @@ func (c *FnController) FnOrderStatus() {
|
||||
}
|
||||
|
||||
// 订单回调
|
||||
if msg["callback_business_type"] != nil {
|
||||
callbackResponse = fn.OnWaybillMsg(msg)
|
||||
}
|
||||
|
||||
callbackResponse = fn.OnWaybillMsg(msg)
|
||||
c.Data["json"] = callbackResponse
|
||||
c.ServeJSON()
|
||||
} else {
|
||||
@@ -43,7 +38,7 @@ func (c *FnController) FnOrderStatus() {
|
||||
func (c *FnController) FnAbnormal() {
|
||||
if c.Ctx.Input.Method() == http.MethodPost {
|
||||
fmt.Println("开始回调异常回调==========================")
|
||||
msg, callbackResponse := api.FnAPI.GetChainstoreStatusNotify(c.Ctx.Request)
|
||||
msg, callbackResponse := api.FnAPI.GetChainAbnormaltatusNotify(c.Ctx.Request)
|
||||
fmt.Println("开始回调异常回调==========================msg", msg)
|
||||
fmt.Println("开始回调异常回调==========================callbackResponse", callbackResponse)
|
||||
if callbackResponse.Code != 1 {
|
||||
@@ -52,18 +47,7 @@ func (c *FnController) FnAbnormal() {
|
||||
return
|
||||
}
|
||||
|
||||
// 订单回调
|
||||
if msg["callback_business_type"] != nil {
|
||||
data := &fnpsapi.AbnormalReportNotify{}
|
||||
if err := utils.Map2StructByJson(msg, data, true); err != nil {
|
||||
callbackResponse = &fnpsapi.CallbackResponse{Code: -1}
|
||||
c.Data["json"] = callbackResponse
|
||||
c.ServeJSON()
|
||||
return
|
||||
}
|
||||
callbackResponse = fn.OnWaybillExceptFn(data)
|
||||
}
|
||||
|
||||
callbackResponse = fn.OnWaybillExceptFn(msg.Param)
|
||||
c.Data["json"] = callbackResponse
|
||||
c.ServeJSON()
|
||||
} else {
|
||||
@@ -84,10 +68,7 @@ func (c *FnController) FnStoreStatus() {
|
||||
return
|
||||
}
|
||||
|
||||
if msg["callback_business_type"] != nil {
|
||||
callbackResponse = fn.OnStoreStatus(msg)
|
||||
}
|
||||
|
||||
callbackResponse = fn.OnStoreStatus(msg)
|
||||
c.Data["json"] = callbackResponse
|
||||
c.ServeJSON()
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user