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) {

View File

@@ -310,7 +310,6 @@ func (a *API) SkuCreate(trackInfo, shopID string, customSkuID int64, params map[
defParams["brand_name"] = "无" // 很狗血的是,你还必须填个无才行。。。
}*/
params = utils.MergeMaps(params, defParams)
// baseapi.SugarLogger.Debugf(utils.Format4Output(params, false))
result, err := a.AccessAPI2("sku.create", params, trackInfo)
if err == nil && result.Data != nil {
return utils.Interface2Int64WithDefault(result.Data.(map[string]interface{})[KeySkuID], 0), nil

View File

@@ -6,7 +6,6 @@ import (
"strings"
"time"
"git.rosy.net.cn/baseapi"
"git.rosy.net.cn/baseapi/platformapi"
"git.rosy.net.cn/baseapi/utils"
)
@@ -667,7 +666,6 @@ func (a *API) AccessStorePage2(subURL, storeURL2 string, params map[string]inter
if code == ResponseCodeCallElmFailed {
return platformapi.ErrLevelRecoverableErr, newErr
}
baseapi.SugarLogger.Debugf("ebai AccessStorePage failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
return platformapi.ErrLevelCodeIsNotOK, newErr
})
return retVal, err