- 重要修改相关的函数新增trackInfo参数,追踪修改人.接口类型改变
This commit is contained in:
@@ -91,7 +91,7 @@ func (a *API) getShopID(body map[string]interface{}) (shopID string) {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (a *API) AccessAPI(cmd string, body map[string]interface{}) (retVal *ResponseResult, err error) {
|
||||
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))
|
||||
@@ -114,6 +114,9 @@ func (a *API) AccessAPI(cmd string, body map[string]interface{}) (retVal *Respon
|
||||
request, _ := http.NewRequest(http.MethodPost, prodURL, strings.NewReader(encodedParams))
|
||||
request.Header.Set("Content-Type", "application/x-www-form-urlencoded")
|
||||
request.Header.Set("User-Agent", "ebai-golang-api")
|
||||
if trackInfo != "" {
|
||||
request.Header.Set(platformapi.KeyTrackInfo, trackInfo)
|
||||
}
|
||||
return request
|
||||
},
|
||||
a.config,
|
||||
@@ -147,6 +150,10 @@ func (a *API) AccessAPI(cmd string, body map[string]interface{}) (retVal *Respon
|
||||
return retVal, err
|
||||
}
|
||||
|
||||
func (a *API) AccessAPI(cmd string, body map[string]interface{}) (retVal *ResponseResult, err error) {
|
||||
return a.AccessAPI2(cmd, body, "")
|
||||
}
|
||||
|
||||
func (a *API) GetSupplierID() (supplierID int64) {
|
||||
a.locker.RLock()
|
||||
supplierID = a.supplierID
|
||||
|
||||
Reference in New Issue
Block a user