1
This commit is contained in:
@@ -2,7 +2,6 @@ package ebaiapi
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"git.rosy.net.cn/jx-callback/globals"
|
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
@@ -328,8 +327,7 @@ func (a *API) SkuCreate(trackInfo, shopID string, customSkuID int64, params map[
|
|||||||
KeyShopID: shopID,
|
KeyShopID: shopID,
|
||||||
KeyCustomSkuID: customSkuID,
|
KeyCustomSkuID: customSkuID,
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debugf("----SkuCreate,params1 -- : %s", utils.Format4Output(params, false))
|
if utils.IsNil(params["upc"]) {
|
||||||
if params["upc"] == nil {
|
|
||||||
defParams["upc"] = "upc-" + utils.Int2Str(int(customSkuID))
|
defParams["upc"] = "upc-" + utils.Int2Str(int(customSkuID))
|
||||||
}
|
}
|
||||||
/*if params["brand_id"] == nil {
|
/*if params["brand_id"] == nil {
|
||||||
@@ -339,7 +337,6 @@ func (a *API) SkuCreate(trackInfo, shopID string, customSkuID int64, params map[
|
|||||||
defParams["brand_name"] = "无" // 很狗血的是,你还必须填个无才行。。。
|
defParams["brand_name"] = "无" // 很狗血的是,你还必须填个无才行。。。
|
||||||
}*/
|
}*/
|
||||||
params = utils.MergeMaps(params, defParams)
|
params = utils.MergeMaps(params, defParams)
|
||||||
globals.SugarLogger.Debugf("----SkuCreate,params2 -- : %s", utils.Format4Output(params, false))
|
|
||||||
result, err := a.AccessAPI2("sku.create", params, trackInfo)
|
result, err := a.AccessAPI2("sku.create", params, trackInfo)
|
||||||
if err == nil && result.Data != nil {
|
if err == nil && result.Data != nil {
|
||||||
return utils.Interface2Int64WithDefault(result.Data.(map[string]interface{})[KeySkuID], 0), nil
|
return utils.Interface2Int64WithDefault(result.Data.(map[string]interface{})[KeySkuID], 0), nil
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ func TestSkuCreate(t *testing.T) {
|
|||||||
"sale_price": 13200,
|
"sale_price": 13200,
|
||||||
"seven_days_no_reason": false,
|
"seven_days_no_reason": false,
|
||||||
"status": "1",
|
"status": "1",
|
||||||
"upc": "3004279768217",
|
"upc": "",
|
||||||
"weight": "500",
|
"weight": "500",
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import (
|
|||||||
"crypto/md5"
|
"crypto/md5"
|
||||||
"fmt"
|
"fmt"
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"git.rosy.net.cn/jx-callback/globals"
|
|
||||||
"mime/multipart"
|
"mime/multipart"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
@@ -150,7 +149,6 @@ func (a *API) AccessAPI2(cmd string, isGet bool, bizParams map[string]interface{
|
|||||||
}
|
}
|
||||||
signURL := a.genURL(cmd) + "?"
|
signURL := a.genURL(cmd) + "?"
|
||||||
params[signKey] = a.signParams(signURL, params)
|
params[signKey] = a.signParams(signURL, params)
|
||||||
globals.SugarLogger.Debugf("-----sing := %s", params[signKey].(string))
|
|
||||||
err = platformapi.AccessPlatformAPIWithRetry(a.client,
|
err = platformapi.AccessPlatformAPIWithRetry(a.client,
|
||||||
func() *http.Request {
|
func() *http.Request {
|
||||||
var request *http.Request
|
var request *http.Request
|
||||||
|
|||||||
Reference in New Issue
Block a user