1
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
@@ -57,7 +56,6 @@ func (a *API) AccessAPI(action string, params map[string]interface{}) (retVal ma
|
||||
errLevel = platformapi.ErrLevelGeneralFail
|
||||
errMsg := jsonResult1["msg"].(string)
|
||||
err = utils.NewErrorCode(errMsg, utils.Int64ToStr(utils.Interface2Int64WithDefault(jsonResult1["status"], 0)))
|
||||
baseapi.SugarLogger.Debugf("aliupc AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
}
|
||||
retVal = jsonResult1
|
||||
}
|
||||
@@ -84,7 +82,6 @@ func (a *API) AccessAPI2(action string, params map[string]interface{}) (retVal m
|
||||
errLevel = platformapi.ErrLevelGeneralFail
|
||||
errMsg := "未查询到数据!"
|
||||
err = utils.NewErrorCode(errMsg, "-1")
|
||||
baseapi.SugarLogger.Debugf("aliupc AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
}
|
||||
retVal = jsonResult1
|
||||
}
|
||||
|
||||
@@ -239,7 +239,6 @@ func (a *API) signParams(mapData map[string]interface{}) string {
|
||||
finalStr += k + "=" + fmt.Sprint(mapData[k])
|
||||
}
|
||||
|
||||
// baseapi.SugarLogger.Debugf("sign str:%v", finalStr)
|
||||
return fmt.Sprintf("%X", md5.Sum([]byte(finalStr)))
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
@@ -31,7 +30,6 @@ func (a *API) AccessStorePage(fullURL string, bizParams map[string]interface{})
|
||||
if jsonResult1["info"].(string) != "OK" {
|
||||
errLevel = platformapi.ErrLevelGeneralFail
|
||||
err = utils.NewErrorCode(jsonResult1["info"].(string), jsonResult1["infocode"].(string))
|
||||
baseapi.SugarLogger.Debugf("autonavi_page AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
}
|
||||
retVal = jsonResult1
|
||||
}
|
||||
|
||||
@@ -89,7 +89,6 @@ func (a *API) signParams(apiStr string, mapData map[string]interface{}) string {
|
||||
strList = append(strList, k+"="+url.QueryEscape(fmt.Sprint(mapData[k])))
|
||||
}
|
||||
finalStr := "/" + apiStr + "?" + strings.Join(strList, "&") + a.sk
|
||||
// baseapi.SugarLogger.Debugf("sign str:%v", finalStr)
|
||||
finalStr = url.QueryEscape(finalStr)
|
||||
return fmt.Sprintf("%x", md5.Sum([]byte(finalStr)))
|
||||
}
|
||||
|
||||
@@ -53,7 +53,6 @@ func (a *API) signCallbackParams(mapData map[string]interface{}) string {
|
||||
sort.Strings(values)
|
||||
|
||||
finalStr := strings.Join(values, "")
|
||||
// baseapi.SugarLogger.Debugf("sign str:%v", finalStr)
|
||||
return fmt.Sprintf("%x", md5.Sum([]byte(finalStr)))
|
||||
}
|
||||
|
||||
|
||||
@@ -91,7 +91,6 @@ func (a *API) signParams(mapData map[string]interface{}) string {
|
||||
}
|
||||
|
||||
finalStr += a.appSecret
|
||||
// baseapi.SugarLogger.Debugf("sign str:%v", finalStr)
|
||||
return fmt.Sprintf("%X", md5.Sum([]byte(finalStr)))
|
||||
}
|
||||
|
||||
|
||||
@@ -224,7 +224,6 @@ func (a *API) GetCallbackMsg(formMap map[string]interface{}, bodyData []byte) (m
|
||||
} else {
|
||||
var descryptMsg string
|
||||
if descryptMsg, err = a.Decrypt(formMap["signature"].(string), formMap["timestamp"].(string), formMap["nonce"].(string), encrypt); err == nil {
|
||||
baseapi.SugarLogger.Debugf("dingding GetCallbackMsg descryptMsg:%s", descryptMsg)
|
||||
err = utils.UnmarshalUseNumber([]byte(descryptMsg), &msgMap)
|
||||
} else {
|
||||
baseapi.SugarLogger.Debugf("dingdingapi GetCallbackMsg, Decrypt err :", err)
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -9,7 +9,6 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
@@ -89,7 +88,6 @@ func (a *API) AccessAPI(action string, url string, bizParams map[string]interfac
|
||||
if utils.MustInterface2Int64(jsonResult1["code"]) != 200 {
|
||||
errLevel = platformapi.ErrLevelGeneralFail
|
||||
err = utils.NewErrorCode(jsonResult1["msg"].(string), utils.Int64ToStr(utils.MustInterface2Int64(jsonResult1["code"])))
|
||||
baseapi.SugarLogger.Debugf("ejiay AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
}
|
||||
retVal = jsonResult1
|
||||
}
|
||||
|
||||
@@ -11,8 +11,6 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
@@ -63,7 +61,6 @@ type payload struct {
|
||||
}
|
||||
|
||||
func New(token, appKey, secret string, isProd bool, config ...*platformapi.APIConfig) *API {
|
||||
// baseapi.SugarLogger.Debugf("token=%v, appKey=%v, secret=%v", token, appKey, secret)
|
||||
curConfig := platformapi.DefAPIConfig
|
||||
if len(config) > 0 {
|
||||
curConfig = *config[0]
|
||||
@@ -120,7 +117,6 @@ func (a *API) signParamsMap(mapData map[string]interface{}, prefix string) strin
|
||||
|
||||
sort.Strings(keyValues)
|
||||
finalStr := prefix + strings.Join(keyValues, "") + a.secret
|
||||
// baseapi.SugarLogger.Debugf("sign str:%v", finalStr)
|
||||
return fmt.Sprintf("%X", md5.Sum([]byte(finalStr)))
|
||||
}
|
||||
|
||||
@@ -180,7 +176,6 @@ func (a *API) AccessAPI(action string, params map[string]interface{}) (retVal *R
|
||||
} else if code == "SERVER_ERROR" || code == "BIZ_SYSTEM_ERROR" || code == "BIZ_1006" || code == "BUSINESS_ERROR" {
|
||||
return platformapi.ErrLevelRecoverableErr, newErr
|
||||
} else {
|
||||
baseapi.SugarLogger.Debugf("AccessAPI elmapi failed, payload:%v jsonResult1:%v", pl, jsonResult1)
|
||||
return platformapi.ErrLevelCodeIsNotOK, newErr
|
||||
}
|
||||
})
|
||||
|
||||
@@ -4,7 +4,6 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"net/http"
|
||||
@@ -126,7 +125,6 @@ func (a *API) AccessAPI(baseUrl, actionApi, method string, bizParams map[string]
|
||||
if utils.MustInterface2Int64(jsonResult1["errcode"]) != 0 {
|
||||
errLevel = platformapi.ErrLevelGeneralFail
|
||||
err = utils.NewErrorCode(jsonResult1["errmsg"].(string), utils.Int64ToStr(utils.MustInterface2Int64(jsonResult1["errcode"])))
|
||||
baseapi.SugarLogger.Debugf("enterprise wechat AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
}
|
||||
retVal = jsonResult1
|
||||
return errLevel, err
|
||||
|
||||
@@ -8,7 +8,6 @@ import (
|
||||
"time"
|
||||
"unicode"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
@@ -137,7 +136,6 @@ func (a *API) AccessAPI(apiName string, apiParams map[string]interface{}) (retVa
|
||||
} else if _, ok := canRetryCodes[code]; ok {
|
||||
return platformapi.ErrLevelRecoverableErr, newErr
|
||||
} else {
|
||||
baseapi.SugarLogger.Debugf("feie AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
return platformapi.ErrLevelCodeIsNotOK, newErr
|
||||
}
|
||||
})
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
@@ -31,7 +30,6 @@ func (a *API) AccessStorePage(subURL string, params map[string]interface{}) (ret
|
||||
return platformapi.ErrLevelRecoverableErr, fmt.Errorf("mapData is nil")
|
||||
}
|
||||
retVal = jsonResult1
|
||||
baseapi.SugarLogger.Debugf("ebai AccessStorePage failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
return platformapi.ErrLevelSuccess, err
|
||||
})
|
||||
return retVal, err
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -12,7 +12,6 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
@@ -121,7 +120,6 @@ func (a *API) AccessAPI(action string, url string, bizParams map[string]interfac
|
||||
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
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import (
|
||||
"crypto/sha1"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"net/http"
|
||||
@@ -99,7 +98,6 @@ func (a *APIv3) AccessAPIv3(action string, url string, bizParams map[string]inte
|
||||
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
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import (
|
||||
"crypto/md5"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"net/http"
|
||||
@@ -129,7 +128,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["message"].(string), utils.Int64ToStr(utils.MustInterface2Int64(jsonResult1["code"])))
|
||||
baseapi.SugarLogger.Debugf("gome AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
}
|
||||
retVal = jsonResult1
|
||||
return errLevel, err
|
||||
|
||||
@@ -10,7 +10,6 @@ import (
|
||||
"strings"
|
||||
"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(action string, url string, bizParams map[string]interfac
|
||||
if jsonResult1["error"] != nil {
|
||||
errLevel = platformapi.ErrLevelGeneralFail
|
||||
err = utils.NewErrorCode(jsonResult1["error"].(map[string]interface{})["message"].(string), jsonResult1["error"].(map[string]interface{})["code"].(string))
|
||||
baseapi.SugarLogger.Debugf("jdeclp AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
}
|
||||
retVal = jsonResult1
|
||||
}
|
||||
|
||||
@@ -234,7 +234,6 @@ func (a *API) AccessAPI2(apiStr string, jdParams map[string]interface{}, traceIn
|
||||
} else if _, ok := canRetryCodes[code]; ok {
|
||||
return platformapi.ErrLevelRecoverableErr, newErr
|
||||
} else {
|
||||
baseapi.SugarLogger.Debugf("jd AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
return platformapi.ErrLevelCodeIsNotOK, newErr
|
||||
}
|
||||
})
|
||||
|
||||
@@ -661,7 +661,6 @@ func (a *API) BatchAddSku(batchSkuRequestList []*CreateByUpcParam) (pairs []*Cre
|
||||
"batchSkuRequestList": batchSkuRequestList,
|
||||
}, nil, nil, genNoPageResultParser("code", "result", "detail", "0"))
|
||||
if err == nil {
|
||||
// globals.SugarLogger.Debug(utils.Format4Output(result, false))
|
||||
// todo 这个API在找不到UPC创建失败时,code也是0,底层不能判断失败
|
||||
if result2, ok := result.([]interface{}); ok && len(result2) > 0 {
|
||||
detail := utils.Slice2MapSlice(result2)
|
||||
|
||||
@@ -450,7 +450,6 @@ func (a *API) AccessStorePage2(fullURL string, params map[string]interface{}, is
|
||||
} else if _, ok := pageCanRetryCodes[code]; ok {
|
||||
return platformapi.ErrLevelRecoverableErr, newErr
|
||||
} else {
|
||||
baseapi.SugarLogger.Debugf("jd AccessStorePage failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
return platformapi.ErrLevelCodeIsNotOK, newErr
|
||||
}
|
||||
})
|
||||
@@ -503,7 +502,6 @@ func (a *API) AccessStorePage3(fullURL string, params map[string]interface{}, re
|
||||
} else if _, ok := pageCanRetryCodes[code]; ok {
|
||||
return platformapi.ErrLevelRecoverableErr, newErr
|
||||
} else {
|
||||
baseapi.SugarLogger.Debugf("jd AccessStorePage failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
return platformapi.ErrLevelCodeIsNotOK, newErr
|
||||
}
|
||||
})
|
||||
@@ -559,7 +557,6 @@ func (a *API) AccessStorePage4(fullURL string, values string) (retVal interface{
|
||||
} else if _, ok := pageCanRetryCodes[code]; ok {
|
||||
return platformapi.ErrLevelRecoverableErr, newErr
|
||||
} else {
|
||||
baseapi.SugarLogger.Debugf("jd AccessStorePage failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
return platformapi.ErrLevelCodeIsNotOK, newErr
|
||||
}
|
||||
})
|
||||
|
||||
@@ -8,7 +8,6 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
@@ -323,7 +322,6 @@ func (a *API) AccessAPI(action string, url string, bizParams map[string]interfac
|
||||
if jsonResult1["error_response"] != nil {
|
||||
errLevel = platformapi.ErrLevelGeneralFail
|
||||
err = utils.NewErrorCode(jsonResult1["error_response"].(map[string]interface{})["zh_desc"].(string), jsonResult1["error_response"].(map[string]interface{})["code"].(string))
|
||||
baseapi.SugarLogger.Debugf("jdeclp AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
}
|
||||
retVal = jsonResult1
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
@@ -159,7 +158,6 @@ func (a *API) AccessAPI(action string, url string, bizParams map[string]interfac
|
||||
if jsonResult1["error_response"] != nil {
|
||||
errLevel = platformapi.ErrLevelGeneralFail
|
||||
err = utils.NewErrorCode(jsonResult1["error_response"].(map[string]interface{})["zh_desc"].(string), jsonResult1["error_response"].(map[string]interface{})["code"].(string))
|
||||
baseapi.SugarLogger.Debugf("jdeclp AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
}
|
||||
retVal = jsonResult1
|
||||
}
|
||||
@@ -195,7 +193,6 @@ func (a *API) AccessAPI2(action string, pURL string, bizParams map[string]interf
|
||||
if jsonResult1["error_response"] != nil {
|
||||
errLevel = platformapi.ErrLevelGeneralFail
|
||||
err = utils.NewErrorCode(jsonResult1["error_response"].(map[string]interface{})["en_desc"].(string), jsonResult1["error_response"].(map[string]interface{})["code"].(string))
|
||||
baseapi.SugarLogger.Debugf("jdeclp AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
}
|
||||
retVal = jsonResult1
|
||||
}
|
||||
|
||||
@@ -80,7 +80,6 @@ func (a *API) AccessStorePage(fullURL string, bizParams map[string]interface{},
|
||||
if jsonResult1["error_response"] != nil {
|
||||
errLevel = platformapi.ErrLevelGeneralFail
|
||||
err = utils.NewErrorCode(jsonResult1["error_response"].(map[string]interface{})["zh_desc"].(string), jsonResult1["error_response"].(map[string]interface{})["code"].(string))
|
||||
baseapi.SugarLogger.Debugf("jdeclp AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
}
|
||||
retVal = jsonResult1
|
||||
}
|
||||
@@ -127,7 +126,6 @@ func (a *API) AccessStorePage2(fullURL string, bizParams map[string]interface{},
|
||||
if jsonResult1["error_response"] != nil {
|
||||
errLevel = platformapi.ErrLevelGeneralFail
|
||||
err = utils.NewErrorCode(jsonResult1["error_response"].(map[string]interface{})["zh_desc"].(string), jsonResult1["error_response"].(map[string]interface{})["code"].(string))
|
||||
baseapi.SugarLogger.Debugf("jdeclp AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
}
|
||||
retVal = jsonResult1
|
||||
}
|
||||
@@ -162,7 +160,6 @@ func (a *API) AccessStorePage4(fullURL, param string, isPost bool) (retVal map[s
|
||||
if jsonResult1["error_response"] != nil {
|
||||
errLevel = platformapi.ErrLevelGeneralFail
|
||||
err = utils.NewErrorCode(jsonResult1["error_response"].(map[string]interface{})["zh_desc"].(string), jsonResult1["error_response"].(map[string]interface{})["code"].(string))
|
||||
baseapi.SugarLogger.Debugf("jdeclp AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
}
|
||||
retVal = jsonResult1
|
||||
}
|
||||
|
||||
@@ -67,7 +67,6 @@ func (a *API) AccessStorePage(fullURL string, bizParams map[string]interface{},
|
||||
if jsonResult1["error_response"] != nil {
|
||||
errLevel = platformapi.ErrLevelGeneralFail
|
||||
err = utils.NewErrorCode(jsonResult1["error_response"].(map[string]interface{})["zh_desc"].(string), jsonResult1["error_response"].(map[string]interface{})["code"].(string))
|
||||
baseapi.SugarLogger.Debugf("jdeclp AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
}
|
||||
retVal = jsonResult1
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import (
|
||||
"crypto/md5"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"net/http"
|
||||
@@ -94,7 +93,6 @@ func (a *API) AccessAPI(apiName string, apiParams map[string]interface{}) (retVa
|
||||
return platformapi.ErrLevelSuccess, nil
|
||||
}
|
||||
newErr := utils.NewErrorIntCode(jsonResult1["desc"].(string), code)
|
||||
baseapi.SugarLogger.Debugf("jxprint AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
return platformapi.ErrLevelCodeIsNotOK, newErr
|
||||
})
|
||||
return retVal, err
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
@@ -47,7 +46,6 @@ func (a *API) AccessAPI(action string, url string, bizParams map[string]interfac
|
||||
if utils.MustInterface2Int64(jsonResult1["errorCode"]) != http.StatusOK {
|
||||
errLevel = platformapi.ErrLevelGeneralFail
|
||||
err = utils.NewErrorCode(utils.Interface2String(jsonResult1["errorMsg"]), utils.Int64ToStr(utils.MustInterface2Int64(jsonResult1["errorCode"])))
|
||||
baseapi.SugarLogger.Debugf("mtmember AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
}
|
||||
retVal = jsonResult1
|
||||
}
|
||||
|
||||
@@ -137,7 +137,6 @@ func (a *API) GetShopStatusCallbackMsg(request *http.Request) (shopStatusMsg *Ca
|
||||
}
|
||||
err := utils.Map2StructByJson(utils.URLValues2Map(request.PostForm), &shopStatusMsg, true)
|
||||
if err != nil {
|
||||
baseapi.SugarLogger.Debugf("GetShopStatusCallbackMsg failed with err:%v", err)
|
||||
callbackResponse = Err2CallbackResponse(err, "")
|
||||
}
|
||||
return shopStatusMsg, callbackResponse
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
@@ -39,7 +38,6 @@ func (a *API) AccessStorePage(fullURL string, bizParams map[string]interface{},
|
||||
if jsonResult1["error_response"] != nil {
|
||||
errLevel = platformapi.ErrLevelGeneralFail
|
||||
err = utils.NewErrorCode(jsonResult1["error_response"].(map[string]interface{})["zh_desc"].(string), jsonResult1["error_response"].(map[string]interface{})["code"].(string))
|
||||
baseapi.SugarLogger.Debugf("jdeclp AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
}
|
||||
retVal = jsonResult1
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import (
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
@@ -89,7 +88,6 @@ func (a *API) AccessAPI(action string, isPost bool, bizParams map[string]interfa
|
||||
if utils.MustInterface2Int64(jsonResult1["status"]) != 0 {
|
||||
errLevel = platformapi.ErrLevelGeneralFail
|
||||
err = utils.NewErrorCode(jsonResult1["des"].(string), utils.Int64ToStr(utils.MustInterface2Int64(jsonResult1["status"])))
|
||||
baseapi.SugarLogger.Debugf("jdeclp AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
}
|
||||
retVal = jsonResult1
|
||||
}
|
||||
@@ -157,7 +155,6 @@ func (a *API) AccessStorePage(fullURL string, bizParams map[string]interface{},
|
||||
if jsonResult1["error_response"] != nil {
|
||||
errLevel = platformapi.ErrLevelGeneralFail
|
||||
err = utils.NewErrorCode(jsonResult1["error_response"].(map[string]interface{})["zh_desc"].(string), jsonResult1["error_response"].(map[string]interface{})["code"].(string))
|
||||
baseapi.SugarLogger.Debugf("jdeclp AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
}
|
||||
retVal = jsonResult1
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
@@ -45,7 +44,6 @@ func (a *API) AccessActPage(subURL string, params map[string]interface{}, isPost
|
||||
return platformapi.ErrLevelSuccess, nil
|
||||
}
|
||||
newErr := utils.NewErrorIntCode(jsonResult1["msg"].(string), code)
|
||||
baseapi.SugarLogger.Debugf("mtwm AccessUserPage failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
return platformapi.ErrLevelCodeIsNotOK, newErr
|
||||
})
|
||||
return retVal, err
|
||||
@@ -84,7 +82,6 @@ func (a *API) AccessActPage2(subURL string, params map[string]interface{}, isPos
|
||||
return platformapi.ErrLevelSuccess, nil
|
||||
}
|
||||
newErr := utils.NewErrorIntCode(jsonResult1["msg"].(string), code)
|
||||
baseapi.SugarLogger.Debugf("mtwm AccessUserPage failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
return platformapi.ErrLevelCodeIsNotOK, newErr
|
||||
})
|
||||
return retVal, err
|
||||
|
||||
@@ -100,7 +100,6 @@ func (a *API) GetCallbackMsg(request *http.Request) (msg *CallbackMsg, callbackR
|
||||
cmd := strings.Trim(request.URL.EscapedPath(), "/")
|
||||
cmd = cmd[strings.LastIndex(cmd, "/")+1:]
|
||||
// if sign != dataSign.(string) && cmd != MsgTypeStoreStatusChanged {
|
||||
// baseapi.SugarLogger.Debugf("mtwm GetCallbackMsg my sign:%v, data sign:%v", sign, dataSign.(string))
|
||||
// callbackResponse = SignatureIsNotOk
|
||||
// } else {
|
||||
msg = &CallbackMsg{
|
||||
|
||||
@@ -11,7 +11,6 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
@@ -193,7 +192,6 @@ func (a *API) AccessAPI2(cmd string, isGet bool, bizParams map[string]interface{
|
||||
errorInfo := errObj.(map[string]interface{})
|
||||
errCode := int(utils.MustInterface2Int64(errorInfo["code"]))
|
||||
if errCode != ErrCodeSuccess {
|
||||
baseapi.SugarLogger.Debugf("mtwm AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
newErr := utils.NewErrorIntCode(errorInfo["msg"].(string), errCode)
|
||||
if canRetryCodes[errCode] == 1 {
|
||||
return platformapi.ErrLevelExceedLimit, newErr
|
||||
@@ -248,7 +246,6 @@ func (a *API) AccessAPI3(cmd string, isGet bool, bizParams map[string]interface{
|
||||
if errObj, ok := jsonResult1["data"]; ok {
|
||||
errorInfo := errObj.(string)
|
||||
if errorInfo != "ok" {
|
||||
baseapi.SugarLogger.Debugf("mtwm AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
newErr := utils.NewErrorIntCode(jsonResult1["error_list"].([]interface{})[0].(map[string]interface{})["msg"].(string), int(utils.MustInterface2Int64(jsonResult1["error_list"].([]interface{})[0].(map[string]interface{})["code"])))
|
||||
return errLevel, newErr
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
@@ -96,7 +95,6 @@ func (a *API) AccessUserPage2(subURL string, params map[string]interface{}, isPo
|
||||
return platformapi.ErrLevelSuccess, nil
|
||||
}
|
||||
newErr := utils.NewErrorIntCode(jsonResult1["msg"].(string), code)
|
||||
baseapi.SugarLogger.Debugf("mtwm AccessUserPage failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
return platformapi.ErrLevelCodeIsNotOK, newErr
|
||||
})
|
||||
return retVal, err
|
||||
|
||||
@@ -4,7 +4,6 @@ import (
|
||||
"crypto/md5"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"net/http"
|
||||
@@ -89,7 +88,6 @@ func (a *API) AccessAPI(action string, isPost bool, bizParams map[string]interfa
|
||||
if jsonResult1["error_response"] != nil {
|
||||
errLevel = platformapi.ErrLevelGeneralFail
|
||||
err = utils.NewErrorCode(jsonResult1["error_response"].(map[string]interface{})["sub_msg"].(string), utils.Int64ToStr(utils.MustInterface2Int64(jsonResult1["error_response"].(map[string]interface{})["sub_code"])))
|
||||
baseapi.SugarLogger.Debugf("pdd AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
}
|
||||
retVal = jsonResult1
|
||||
}
|
||||
@@ -127,7 +125,6 @@ func (a *API) AccessStorePage(fullURL string, bizParams map[string]interface{},
|
||||
if jsonResult1["error_response"] != nil {
|
||||
errLevel = platformapi.ErrLevelGeneralFail
|
||||
err = utils.NewErrorCode(jsonResult1["error_response"].(map[string]interface{})["zh_desc"].(string), jsonResult1["error_response"].(map[string]interface{})["code"].(string))
|
||||
baseapi.SugarLogger.Debugf("pdd AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
}
|
||||
retVal = jsonResult1
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"compress/gzip"
|
||||
"errors"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"io/ioutil"
|
||||
"math"
|
||||
"net"
|
||||
@@ -117,18 +118,15 @@ func AccessPlatformAPIWithRetry(client *http.Client, handleRequest func() *http.
|
||||
request.Header.Del(KeyTrackInfo)
|
||||
}
|
||||
trackInfo += ", " + utils.GetUUID()
|
||||
baseapi.SugarLogger.Debugf("begin AccessPlatformAPIWithRetry:%s do:%s url:%v, request:%s", trackInfo, request.Method, request.URL, getClonedData(request.URL, savedBuf))
|
||||
response, err := client.Do(request)
|
||||
usedMilliSecond := time.Now().Sub(beginTime) / time.Millisecond
|
||||
baseapi.SugarLogger.Debugf("end AccessPlatformAPIWithRetry:%s do:%s url:%v, usedMilliSecond:%d", trackInfo, request.Method, request.URL, usedMilliSecond)
|
||||
if err != nil {
|
||||
baseapi.SugarLogger.Debugf("AccessPlatformAPIWithRetry:%s client.Get return err:%v", trackInfo, err)
|
||||
err, ok := err.(net.Error)
|
||||
globals.SugarLogger.Debugf("AccessPlatformAPIWithRetry err %s", err)
|
||||
recoverableErrorRetryCount++
|
||||
if ok /*&& err.Timeout()*/ && recoverableErrorRetryCount <= config.MaxRecoverableRetryCount { // 只要是网络错误都重试
|
||||
continue
|
||||
} else {
|
||||
baseapi.SugarLogger.Errorf("AccessPlatformAPIWithRetry:%s access api url:%v, error:%v", trackInfo, request.URL, err)
|
||||
return ErrAPIAccessFailed
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,6 @@ func (a *APICookie) SetCookieWithStr(cookieStr string) {
|
||||
v := utils.TrimBlankChar(pair[1])
|
||||
if k != "" && v != "" {
|
||||
a.SetCookie(k, v)
|
||||
// baseapi.SugarLogger.Debugf("%s=%s", k, v)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +117,6 @@ func (a *Api) AccessInfo(baseUrl, url, requestMethods string, param map[string]i
|
||||
return platformapi.ErrLevelSuccess, nil
|
||||
}
|
||||
newErr := utils.NewErrorIntCode(jsonResult1["msg"].(string), code)
|
||||
baseapi.SugarLogger.Debugf("QBiDa AccessUserPage failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
return platformapi.ErrLevelCodeIsNotOK, newErr
|
||||
})
|
||||
return retVal, err
|
||||
|
||||
@@ -125,14 +125,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 +142,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,7 +164,6 @@ 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
|
||||
}
|
||||
@@ -181,7 +177,6 @@ func (a *API) GetChainAbnormaltatusNotify(request *http.Request) (shopStatusMsg
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
@@ -94,7 +93,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("sfps AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
}
|
||||
retVal = jsonResult1
|
||||
return errLevel, err
|
||||
|
||||
@@ -4,7 +4,6 @@ import (
|
||||
"crypto/md5"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"net/http"
|
||||
@@ -94,7 +93,6 @@ func (a *API) AccessAPI(action string, isPost bool, bizParams map[string]interfa
|
||||
if jsonResult1["error_response"] != nil {
|
||||
errLevel = platformapi.ErrLevelGeneralFail
|
||||
err = utils.NewErrorCode(jsonResult1["error_response"].(map[string]interface{})["msg"].(string), utils.Int64ToStr(utils.MustInterface2Int64(jsonResult1["error_response"].(map[string]interface{})["code"])))
|
||||
baseapi.SugarLogger.Debugf("jdeclp AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
}
|
||||
retVal = jsonResult1
|
||||
}
|
||||
@@ -132,7 +130,6 @@ func (a *API) AccessStorePage(fullURL string, bizParams map[string]interface{},
|
||||
if jsonResult1["error_response"] != nil {
|
||||
errLevel = platformapi.ErrLevelGeneralFail
|
||||
err = utils.NewErrorCode(jsonResult1["error_response"].(map[string]interface{})["zh_desc"].(string), jsonResult1["error_response"].(map[string]interface{})["code"].(string))
|
||||
baseapi.SugarLogger.Debugf("jdeclp AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
}
|
||||
retVal = jsonResult1
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import (
|
||||
"crypto/md5"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"net/http"
|
||||
@@ -91,7 +90,6 @@ func (a *API) AccessAPI(url string, apiParams map[string]interface{}, isJson boo
|
||||
return platformapi.ErrLevelSuccess, nil
|
||||
}
|
||||
newErr := utils.NewErrorIntCode(jsonResult1["message"].(string), code)
|
||||
baseapi.SugarLogger.Debugf("tibiot AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
return platformapi.ErrLevelCodeIsNotOK, newErr
|
||||
})
|
||||
return retVal, err
|
||||
|
||||
@@ -4,7 +4,6 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"net/http"
|
||||
"strings"
|
||||
)
|
||||
@@ -49,6 +48,5 @@ func (a *API) AccessAPI2(url string, params map[string]interface{}) (retVal map[
|
||||
retVal = jsonResult1
|
||||
return platformapi.ErrLevelSuccess, nil
|
||||
})
|
||||
globals.SugarLogger.Debug("我也不知道哪里出错,返回一下retVal", retVal)
|
||||
return retVal, err
|
||||
}
|
||||
|
||||
@@ -3,18 +3,15 @@ package tiktok
|
||||
import (
|
||||
"errors"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
)
|
||||
|
||||
// 获取抖音登录授权2
|
||||
func (a *API) GetTiktokOauth(code string) (*TiktokOauthResone, error) {
|
||||
globals.SugarLogger.Debug("初始code=============", code)
|
||||
tokenReq := make(map[string]interface{}, 3)
|
||||
tokenReq["appid"] = a.GetAppID()
|
||||
tokenReq["code"] = code
|
||||
tokenReq["secret"] = a.GetSecret()
|
||||
tokenReq["anonymous_code"] = ""
|
||||
globals.SugarLogger.Debug("输出tokenReq", tokenReq)
|
||||
result, err := a.AccessAPI2(GetTiktokOauth, tokenReq)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -28,7 +25,6 @@ func (a *API) GetTiktokOauth(code string) (*TiktokOauthResone, error) {
|
||||
if oauthAccessToken.ErrNo != 0 {
|
||||
return nil, errors.New(oauthAccessToken.ErrTips)
|
||||
}
|
||||
globals.SugarLogger.Debug("再来输出一下oauthAccessToken", oauthAccessToken)
|
||||
return oauthAccessToken, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
var token = `{"access_token":"60f530b2-9ab6-4723-b487-c094918f0d21","expires_in":1666257163,"scope":"SCOPE","shop_id":"","shop_name":"小时达开放平台对接专用店","refresh_token":"1220666a-5e88-458c-a8c0-06d949fbbd3f","authority_id":""}`
|
||||
var token = `{"access_token":"47690a84-3cc2-4958-abf9-41cc7fca5f82","expires_in":1666862533,"scope":"SCOPE","shop_id":"","shop_name":"小时达开放平台对接专用店","refresh_token":"66ea2395-07c7-409d-84ae-93ac1e600b74","authority_id":""}`
|
||||
var a = New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", token)
|
||||
|
||||
// 查询售后单详情
|
||||
|
||||
@@ -140,11 +140,6 @@ func (a *API) SetAccessToken(token string) {
|
||||
a.accessToken = access.AccessToken
|
||||
a.refreshToken = access.RefreshToken
|
||||
a.expiresIn = access.ExpiresIn
|
||||
if access.ExpiresIn > time.Now().Unix() {
|
||||
a.accessTokenObj = access
|
||||
} else {
|
||||
a.RefreshToken()
|
||||
}
|
||||
|
||||
a.accessTokenObj = access
|
||||
return
|
||||
}
|
||||
|
||||
@@ -30,8 +30,8 @@ func TestQueryOrderDetail(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestRefaseToken(t *testing.T) {
|
||||
a := New("7136048270014416392", "c397aa9f-3927-47c4-8cfe-4d84e02602e0", "")
|
||||
a.CreateToken("bb52688c-7bca-4b64-8747-5258a9a6ba33")
|
||||
a.CreateToken("c2bcf85f-f8de-4c9e-bcdc-97d792ce7156")
|
||||
//a.RefreshToken()
|
||||
// {"access_token":"a1746210-a8a3-4497-a87b-09d1f10dbb95","expires_in":1665652230,"scope":"SCOPE","shop_id":"","shop_name":"小时达开放平台对接专用店","refresh_token":"c1cf8d88-0983-4f2a-b969-3746fae6b0cd","authority_id":""}
|
||||
//{"access_token":"37f41ac7-49ac-4848-a0ee-ea86bb0dfd9f","expires_in":519389,"scope":"SCOPE","shop_id":"","shop_name":"抖店开放平台测试专用店","refresh_token":"3dd8f638-fdf1-46e7-b974-88df382f03c6","authority_id" :""}
|
||||
}
|
||||
@@ -90,3 +90,7 @@ func TestGetSettleBillDetailV3(t *testing.T) {
|
||||
func TestLogisticsAddSinglePack(t *testing.T) {
|
||||
a.LogisticsAddSinglePack()
|
||||
}
|
||||
|
||||
func TestYearDay(t *testing.T) {
|
||||
fmt.Println(time.Now().YearDay())
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi"
|
||||
address_list_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/address_list/request"
|
||||
afterSale_applyMarketAfterSale_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/afterSale_ApplyMarketAfterSale/request"
|
||||
afterSale_Detail_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/afterSale_Detail/request"
|
||||
@@ -20,7 +19,6 @@ import (
|
||||
order_orderDetail_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/order_orderDetail/response"
|
||||
order_searchList_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/order_searchList/request"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"math"
|
||||
"time"
|
||||
)
|
||||
@@ -327,7 +325,6 @@ func (a *API) LogisticsAdd(orderId string, companyCode string, isRefundReject bo
|
||||
func (a *API) CreateOrderCallback(orderStatus []byte) (map[string][]interface{}, *CallbackResponse) {
|
||||
var resp []*OrderCallback
|
||||
if err := json.Unmarshal(orderStatus, &resp); err != nil {
|
||||
baseapi.SugarLogger.Debugf("Tiktok Notify failed with err:%v", err)
|
||||
return nil, &CallbackResponse{Code: CallbackFailCode, Msg: CallbackFail}
|
||||
}
|
||||
|
||||
@@ -346,7 +343,6 @@ func (a *API) CreateOrderCallback(orderStatus []byte) (map[string][]interface{},
|
||||
return nil, CallbackResponseErr(false)
|
||||
}
|
||||
callbackResult[CallbackPayOrderMsgTagId] = append(callbackResult[CallbackPayOrderMsgTagId], create)
|
||||
globals.SugarLogger.Debugf("CallbackPayOrderMsgTagId======%s", utils.Format4Output(callbackResult, false))
|
||||
case CallbackWaitOrderMsgTagId: // 支付订单待处理(风控审核)
|
||||
create := WaitOrderData{}
|
||||
if err := json.Unmarshal([]byte(data.Data), &create); err != nil {
|
||||
|
||||
@@ -23,8 +23,6 @@ import (
|
||||
sku_editPrice_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/sku_editPrice/request"
|
||||
sku_syncStock_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/sku_syncStock/request"
|
||||
sku_syncStockBatch_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/sku_syncStockBatch/request"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
)
|
||||
|
||||
// UpdateSkuStock
|
||||
@@ -99,7 +97,6 @@ func (a *API) GetCatePropertyV2(categoryLeftId int64) (*product_getCatePropertyV
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
globals.SugarLogger.Debugf("GetCatePropertyV2-------------api:=%s", utils.Format4Output(result, false))
|
||||
if result.Code != RequestSuccessCode {
|
||||
return nil, errors.New(result.SubMsg)
|
||||
}
|
||||
@@ -112,7 +109,6 @@ func (a *API) CreateStoreCommodity(skuParam *product_addV2_request.ProductAddV2P
|
||||
request.Param = skuParam
|
||||
|
||||
result, err := request.Execute(a.accessTokenObj)
|
||||
globals.SugarLogger.Debugf("CreateStoreCommodity-------------api:=%s", utils.Format4Output(result, false))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -46,8 +46,6 @@ import (
|
||||
warehouse_list_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/warehouse_list/response"
|
||||
warehouse_setFence_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/warehouse_setFence/request"
|
||||
warehouse_unbindStore_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/warehouse_unbindStore/request"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
)
|
||||
|
||||
//GetStoreDetail 单个获取门店信息
|
||||
@@ -66,7 +64,6 @@ func (a *API) GetStoreDetail(param *shop_getStoreDetail_request.ShopGetStoreDeta
|
||||
|
||||
//BatchCreateStore 批量创建门店
|
||||
func (a *API) BatchCreateStore(param *shop_batchCreateStore_request.ShopBatchCreateStoreParam) (*shop_batchCreateStore_response.ShopBatchCreateStoreData, error) {
|
||||
globals.SugarLogger.Debugf("BatchCreateStore:%s", utils.Format4Output(param, true))
|
||||
request := shop_batchCreateStore_request.New()
|
||||
request.Param = param
|
||||
response, err := request.Execute(a.accessTokenObj)
|
||||
@@ -81,7 +78,6 @@ func (a *API) BatchCreateStore(param *shop_batchCreateStore_request.ShopBatchCre
|
||||
|
||||
// EditStore 编辑门店
|
||||
func (a *API) EditStore(param *shop_editStore_request.ShopEditStoreParam) error {
|
||||
globals.SugarLogger.Debugf("EditStore EditStore:%s", utils.Format4Output(param, true))
|
||||
request := shop_editStore_request.New()
|
||||
request.Param = param
|
||||
response, err := request.Execute(a.accessTokenObj)
|
||||
|
||||
@@ -7,7 +7,6 @@ import (
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
@@ -176,7 +175,6 @@ func (a *API) AccessAPI(action string, bizParams map[string]interface{}) (retVal
|
||||
if returnCode != TrxStatusSuccess {
|
||||
errLevel = platformapi.ErrLevelGeneralFail
|
||||
err = utils.NewErrorCode(utils.Interface2String(jsonResult1["errmsg"])+utils.Interface2String(jsonResult1["retmsg"]), returnCode)
|
||||
baseapi.SugarLogger.Debugf("tonglianpay AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
}
|
||||
retVal = jsonResult1
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
@@ -83,7 +82,6 @@ func (a *API) AccessAPI(url string, params map[string]interface{}) (retVal map[s
|
||||
if jsonResult1["code"].(string) != "OK" {
|
||||
errLevel = platformapi.ErrLevelGeneralFail
|
||||
err = utils.NewErrorCode(jsonResult1["msg"].(string), jsonResult1["code"].(string))
|
||||
baseapi.SugarLogger.Debugf("txcloud AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
}
|
||||
retVal = jsonResult1
|
||||
}
|
||||
@@ -113,7 +111,6 @@ func (a *API) AccessAPI2(url string, params map[string]interface{}) (retVal map[
|
||||
if !jsonResult1["Result"].(map[string]interface{})["success"].(bool) {
|
||||
errLevel = platformapi.ErrLevelGeneralFail
|
||||
err = utils.NewErrorCode(jsonResult1["Result"].(map[string]interface{})["errMsg"].(string), "false")
|
||||
baseapi.SugarLogger.Debugf("txcloud AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
}
|
||||
retVal = jsonResult1
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
@@ -96,7 +95,6 @@ func (a *API) AccessAPI(action string, bizParams map[string]interface{}) (retVal
|
||||
if jsonResult1["msg"].(string) != "success" {
|
||||
errLevel = platformapi.ErrLevelGeneralFail
|
||||
err = utils.NewErrorCode(jsonResult1["msg"].(string), utils.Int64ToStr(utils.MustInterface2Int64(jsonResult1["code"])))
|
||||
baseapi.SugarLogger.Debugf("unipush AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
}
|
||||
retVal = jsonResult1["data"].(map[string]interface{})
|
||||
}
|
||||
@@ -124,7 +122,6 @@ func (a *API) AccessAPI2(action string, bizParams map[string]interface{}) (retVa
|
||||
if jsonResult1["msg"].(string) != "success" {
|
||||
errLevel = platformapi.ErrLevelGeneralFail
|
||||
err = utils.NewErrorCode(jsonResult1["msg"].(string), utils.Int64ToStr(utils.MustInterface2Int64(jsonResult1["code"])))
|
||||
baseapi.SugarLogger.Debugf("unipush AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
}
|
||||
retVal = jsonResult1
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ import (
|
||||
"net/http"
|
||||
"sync"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
@@ -195,7 +194,6 @@ func (a *API) AccessAPI(apiStr string, apiParams map[string]interface{}) (retVal
|
||||
} else if _, ok := canRetryCodes[code]; ok {
|
||||
return platformapi.ErrLevelRecoverableErr, newErr
|
||||
} else {
|
||||
baseapi.SugarLogger.Debugf("weimob AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
return platformapi.ErrLevelCodeIsNotOK, newErr
|
||||
}
|
||||
})
|
||||
|
||||
@@ -5,8 +5,6 @@ import (
|
||||
"fmt"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
)
|
||||
|
||||
func (a *API) SetMsgTokenAndKey(msgToken, msgKey string) {
|
||||
@@ -36,6 +34,5 @@ func (a *API) ValidateWXCallbackURL(signature, timestamp, nonce string) (isValid
|
||||
}
|
||||
sort.Sort(sort.StringSlice(strList))
|
||||
sha1Str := fmt.Sprintf("%x", sha1.Sum([]byte(strings.Join(strList, ""))))
|
||||
baseapi.SugarLogger.Debugf("ValidateWXCallbackURL sha1Str:%s, signature:%s", sha1Str, signature)
|
||||
return sha1Str == signature
|
||||
}
|
||||
|
||||
@@ -502,7 +502,6 @@ func (a *API) AccessAPI(action string, requestParam IRequestBase) (retVal map[st
|
||||
if utils.Interface2String(retVal["result_code"]) != ResponseCodeSuccess {
|
||||
err = utils.NewErrorCode(utils.Interface2String(retVal["err_code_des"]), utils.Interface2String(retVal["err_code"]))
|
||||
if err != nil {
|
||||
baseapi.SugarLogger.Debugf("wxpay AccessAPI %s failed:%s, err:%v", signStr, strings.ReplaceAll(responseStr, "\\n", " "), err)
|
||||
}
|
||||
retVal = nil
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
@@ -96,7 +95,6 @@ func (a *API) AccessAPI(apiName string, apiParams map[string]interface{}) (retVa
|
||||
} else if _, ok := canRetryCodes[code]; ok {
|
||||
return platformapi.ErrLevelRecoverableErr, newErr
|
||||
} else {
|
||||
baseapi.SugarLogger.Debugf("xiaowm AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
return platformapi.ErrLevelCodeIsNotOK, newErr
|
||||
}
|
||||
})
|
||||
|
||||
@@ -8,7 +8,6 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
@@ -124,7 +123,6 @@ func (a *API) AccessAPI(apiName string, apiParams map[string]interface{}, token
|
||||
} else if _, ok := canRetryCodes[code]; ok {
|
||||
return platformapi.ErrLevelRecoverableErr, newErr
|
||||
} else {
|
||||
baseapi.SugarLogger.Debugf("yilianyun AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
return platformapi.ErrLevelCodeIsNotOK, newErr
|
||||
}
|
||||
})
|
||||
|
||||
@@ -46,7 +46,6 @@ func (a *API) AccessStorePage(action string, bizParams map[string]interface{}) (
|
||||
if !jsonResult1["successed"].(bool) {
|
||||
errLevel = platformapi.ErrLevelGeneralFail
|
||||
err = utils.NewErrorCode(jsonResult1["msg"].(string), "-1", 0)
|
||||
baseapi.SugarLogger.Debugf("yinbao AccessStorePageAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
}
|
||||
} else {
|
||||
errLevel = platformapi.ErrLevelGeneralFail
|
||||
|
||||
@@ -9,7 +9,6 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
@@ -100,7 +99,6 @@ func (a *API) AccessAPI(action string, bizParams map[string]interface{}) (retVal
|
||||
errMsg += v.(string)
|
||||
}
|
||||
err = utils.NewErrorCode(errMsg, utils.Int64ToStr(utils.Interface2Int64WithDefault(jsonResult1["errorCode"], 0)))
|
||||
baseapi.SugarLogger.Debugf("yinbao AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
}
|
||||
retVal = jsonResult1
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
@@ -103,7 +102,6 @@ func (a *API) AccessAPI(apiName string, apiParams map[string]interface{}, isGet
|
||||
} else if _, ok := canRetryCodes[code]; ok {
|
||||
return platformapi.ErrLevelRecoverableErr, newErr
|
||||
} else {
|
||||
baseapi.SugarLogger.Debugf("zhongwu AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
return platformapi.ErrLevelCodeIsNotOK, newErr
|
||||
}
|
||||
})
|
||||
|
||||
@@ -6,7 +6,6 @@ import (
|
||||
"fmt"
|
||||
"runtime/debug"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
)
|
||||
|
||||
@@ -60,7 +59,6 @@ func callHandler(handler func()) (retVal interface{}) {
|
||||
func taskFun(taskChan chan *TaskParam, index int) {
|
||||
for {
|
||||
taskParam := <-taskChan
|
||||
baseapi.SugarLogger.Debugf("routine:%d, handle task:%v", index, taskParam.handler)
|
||||
result := callHandler(taskParam.handler)
|
||||
if taskParam.resultChan != nil {
|
||||
taskParam.resultChan <- result
|
||||
|
||||
@@ -4,8 +4,6 @@ import (
|
||||
"bytes"
|
||||
"crypto/aes"
|
||||
"crypto/cipher"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
)
|
||||
|
||||
func AESCBCEncpryt(data, aesKey, iv []byte) (encryptedData []byte, err error) {
|
||||
@@ -36,7 +34,6 @@ func PKCSUnPadding(originData []byte) []byte {
|
||||
length := len(originData)
|
||||
unpadding := int(originData[length-1])
|
||||
originData = originData[:(length - unpadding)]
|
||||
baseapi.SugarLogger.Debugf("PKCSUnPadding, length:%d, unpadding:%d", length, unpadding)
|
||||
return originData
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user