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
}

View File

@@ -12,7 +12,6 @@ import (
"sync"
"time"
"git.rosy.net.cn/baseapi"
"git.rosy.net.cn/baseapi/platformapi"
"git.rosy.net.cn/baseapi/utils"
)
@@ -115,7 +114,6 @@ func (a *API) AccessAPI(baseUrl, actionApi, method string, bizParams map[string]
if utils.MustInterface2Int64(jsonResult1["code"]) != 200 {
errLevel = platformapi.ErrLevelGeneralFail
err = utils.NewErrorCode(jsonResult1["msg"].(string), utils.Int64ToStr(utils.MustInterface2Int64(jsonResult1["code"])))
baseapi.SugarLogger.Debugf("fnps AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
}
retVal = jsonResult1
return errLevel, err