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

@@ -8,7 +8,6 @@ import (
"sort"
"strings"
"git.rosy.net.cn/baseapi"
"git.rosy.net.cn/baseapi/platformapi"
"git.rosy.net.cn/baseapi/utils"
)
@@ -92,8 +91,6 @@ func (a *API) GetSource() string {
}
func (a *API) AccessAPI2(cmd string, body map[string]interface{}, trackInfo string) (retVal *ResponseResult, err error) {
baseapi.SugarLogger.Debugf("ebai AccessAPI cmd:%s", cmd)
// a.speedLimiter.AccessAPI(allAPI)
a.speedLimiter.AccessAPI(cmd, a.getShopID(body))
if body == nil {
body = make(map[string]interface{}, 0)
@@ -133,7 +130,6 @@ func (a *API) AccessAPI2(cmd string, body map[string]interface{}, trackInfo stri
if retVal.ErrNo == ResponseCodeSuccess {
return platformapi.ErrLevelSuccess, nil
}
baseapi.SugarLogger.Debugf("ebai AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
newErr := utils.NewErrorIntCode(retVal.Error, retVal.ErrNo)
// todo 临时处理超过阈值错...
if (newErr.IntCode() == 20501 && strings.Index(retVal.Error, "阈值") >= 0) || (newErr.IntCode() == 20502 && strings.Index(retVal.Error, "系统繁忙") >= 0) {