This commit is contained in:
邹宗楠
2022-10-22 22:45:36 +08:00
parent c862340c56
commit 2ed93fe209
66 changed files with 10 additions and 156 deletions

View File

@@ -2,7 +2,6 @@ package fnpsapi
import (
"encoding/json"
"git.rosy.net.cn/baseapi"
"io/ioutil"
"net/http"
)
@@ -125,14 +124,12 @@ func (a *API) GetChainstoreStatusNotify(request *http.Request) (shopStatusMsg *C
storeNotify := &ShortStatus{}
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
}
fnNotify := &ChainstoreStatusNotify{}
if err := json.Unmarshal([]byte(storeNotify.BusinessData), fnNotify); err != nil {
baseapi.SugarLogger.Debugf("FN callback string to GetChainstoreStatusNotify failed with err:%v", err)
callbackResponse = &CallbackResponse{Code: -1}
return nil, callbackResponse
}
@@ -144,7 +141,6 @@ func (a *API) GetChainstoreStatusNotify(request *http.Request) (shopStatusMsg *C
func (a *API) GetChainOrderStatusNotify(request *http.Request) (shopStatusMsg *OrderStatusNottify, callbackResponse *CallbackResponse) {
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
}
@@ -167,21 +163,18 @@ func (a *API) GetChainOrderStatusNotify(request *http.Request) (shopStatusMsg *O
func (a *API) GetChainAbnormaltatusNotify(request *http.Request) (shopStatusMsg *AbnormalStatusNotify, callbackResponse *CallbackResponse) {
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 := &ShortStatus{}
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
}
fnNotify := &AbnormalStatusNotify{}
if err := json.Unmarshal([]byte(storeNotify.BusinessData), fnNotify); err != nil {
baseapi.SugarLogger.Debugf("FN callback string to ChainstoreStatusNotify failed with err:%v", err)
callbackResponse = &CallbackResponse{Code: -1}
return nil, callbackResponse
}