修改返回值
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package fnpsapi
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi"
|
||||
@@ -46,11 +45,6 @@ type ShortStatus struct {
|
||||
|
||||
//#region 订单
|
||||
|
||||
type OrderErr struct {
|
||||
CallbackBusinessType string `json:"callback_business_type"`
|
||||
Param *OrderStatusNottify `json:"param"`
|
||||
}
|
||||
|
||||
// 订单状态
|
||||
type OrderStatusNottify struct {
|
||||
CallbackBusinessType string `json:"callback_business_type"`
|
||||
@@ -160,27 +154,21 @@ func (a *API) GetChainOrderStatusNotify(request *http.Request) (shopStatusMsg *O
|
||||
|
||||
//if true { // 第二次平台分配骑手
|
||||
fmt.Println("==============", string(data))
|
||||
fmt.Println("==============2222", bytes.NewBuffer(data).String())
|
||||
result := &OrderStatusNottify{}
|
||||
result := &ShortStatus{}
|
||||
if err := json.Unmarshal(data, &result); err != nil {
|
||||
callbackResponse = &CallbackResponse{Code: -1}
|
||||
return nil, callbackResponse
|
||||
}
|
||||
fmt.Println("data=======", result.Param)
|
||||
fmt.Println("data=======", result.Param.OrderId)
|
||||
fmt.Println("data=======", result.Param.PartnerOrderCode)
|
||||
//} else { // 第一次,平台确认收取订单
|
||||
// result := &OrderErr{}
|
||||
// if err := json.Unmarshal(data, &result); err != nil {
|
||||
// callbackResponse = &CallbackResponse{Code: -1}
|
||||
// return nil, callbackResponse
|
||||
// }
|
||||
// fmt.Println("data=======", result.Param)
|
||||
// fmt.Println("data=======", result.Param.Param.OrderId)
|
||||
// fmt.Println("data=======", result.Param.Param.PartnerOrderCode)
|
||||
//}
|
||||
|
||||
return result, SuccessResponse
|
||||
orderResult := &OrderStatusNottify{}
|
||||
if err := json.Unmarshal([]byte(result.BusinessData), orderResult); err != nil {
|
||||
callbackResponse = &CallbackResponse{Code: -1}
|
||||
return nil, callbackResponse
|
||||
}
|
||||
fmt.Println("==============orderResult", orderResult)
|
||||
fmt.Println("==============orderResult", orderResult.Param)
|
||||
fmt.Println("==============orderResult", orderResult.Param.PartnerOrderCode)
|
||||
return orderResult, SuccessResponse
|
||||
}
|
||||
|
||||
// 异常配送
|
||||
|
||||
Reference in New Issue
Block a user