diff --git a/platformapi/ebaiapi/ebaiapi_test.go b/platformapi/ebaiapi/ebaiapi_test.go index ca92c7e9..45d5f892 100644 --- a/platformapi/ebaiapi/ebaiapi_test.go +++ b/platformapi/ebaiapi/ebaiapi_test.go @@ -12,7 +12,7 @@ import ( ) const ( - testShopBaiduID = 2233909607 + testShopBaiduID = 2233976901 testShopID = "100077" ) diff --git a/platformapi/ebaiapi/shop_sku.go b/platformapi/ebaiapi/shop_sku.go index 82a63129..04b042da 100644 --- a/platformapi/ebaiapi/shop_sku.go +++ b/platformapi/ebaiapi/shop_sku.go @@ -119,7 +119,7 @@ func (a *API) SkuCreate(shopID string, customSkuID int, params map[string]interf } if params["upc"] == nil { defParams["upc_type"] = UPCTypePrivate - defParams["upc"] = "无" + defParams["upc"] = "upc-" + utils.Int2Str(customSkuID) } if params["brand_id"] == nil { defParams["brand_id"] = 0 @@ -127,8 +127,9 @@ func (a *API) SkuCreate(shopID string, customSkuID int, params map[string]interf if params["brand_name"] == nil { defParams["brand_name"] = "无" // 很狗血的是,你还必须填个无才行。。。 } - - result, err := a.AccessAPI("sku.create", utils.MergeMaps(params, defParams)) + params = utils.MergeMaps(params, defParams) + // baseapi.SugarLogger.Debugf(utils.Format4Output(params, false)) + result, err := a.AccessAPI("sku.create", params) if err == nil { return utils.Str2Int64(utils.Interface2String(result.Data.(map[string]interface{})["sku_id"])), nil } diff --git a/platformapi/ebaiapi/shop_test.go b/platformapi/ebaiapi/shop_test.go index c649d3cc..75f6f757 100644 --- a/platformapi/ebaiapi/shop_test.go +++ b/platformapi/ebaiapi/shop_test.go @@ -43,9 +43,16 @@ func TestShopGet(t *testing.T) { func TestShopUpdate(t *testing.T) { params := map[string]interface{}{ - KeyShopID: testShopID, - KeyName: "hello", - "phone": "13812345678", + KeyName: "好菜鲜生-测试店1", + KeyPhone: "13812345678", + KeyBaiduShopID: 2233976901, + "longitude": 116.307884, + "latitude": 40.036828, + "coord_type": "amap", + "province": "131", + "city": "131", + "county": "1960", + "address": "北京市海淀区上地信息路甲9号", } err := api.ShopUpdate(params) if err != nil {