This commit is contained in:
邹宗楠
2022-03-31 17:43:17 +08:00
parent 059297840f
commit e516584705

View File

@@ -123,8 +123,8 @@ func (a *API) GetChainstoreStatusNotify(request *http.Request) (shopStatusMsg *C
}
storeNotify := make(map[string]interface{}, 4)
if err := utils.Map2StructByJson(data, storeNotify, true); err != nil {
baseapi.SugarLogger.Debugf("FN GetShopStatusCallbackMsg failed with err:%v", err)
if err := json.Unmarshal(data, storeNotify); err != nil {
baseapi.SugarLogger.Debugf("FN GetChainstoreStatusNotify failed with err:%v", err)
callbackResponse = &CallbackResponse{Code: -1}
return nil, callbackResponse
}
@@ -170,16 +170,22 @@ func (a *API) GetChainOrderStatusNotify(request *http.Request) (shopStatusMsg *O
// 异常配送
func (a *API) GetChainAbnormaltatusNotify(request *http.Request) (shopStatusMsg *AbnormalStatusNotify, callbackResponse *CallbackResponse) {
storeNotify := ShortStatus{}
err := utils.Map2StructByJson(utils.URLValues2Map(request.PostForm), &storeNotify, true)
data, err := ioutil.ReadAll(request.Body)
if err != nil {
baseapi.SugarLogger.Debugf("FN GetChainOrderStatusNotify failed with No result msg err:%v", err)
callbackResponse = &CallbackResponse{Code: -1}
return nil, callbackResponse
}
storeNotify := make(map[string]interface{}, 4)
if err := json.Unmarshal(data, storeNotify); err != nil {
baseapi.SugarLogger.Debugf("FN GetShopStatusCallbackMsg failed with err:%v", err)
callbackResponse = &CallbackResponse{Code: -1}
return nil, callbackResponse
}
fmt.Println("======================", storeNotify)
fnNotify := &AbnormalStatusNotify{}
if err := json.Unmarshal([]byte(utils.Interface2String(storeNotify.BusinessData)), fnNotify); err != nil {
if err := json.Unmarshal([]byte(utils.Interface2String(storeNotify["business_data"])), fnNotify); err != nil {
baseapi.SugarLogger.Debugf("FN callback string to ChainstoreStatusNotify failed with err:%v", err)
callbackResponse = &CallbackResponse{Code: -1}
return nil, callbackResponse