From 00cbc8f635f50196e428367fd34164b4e4ac4963 Mon Sep 17 00:00:00 2001 From: gazebo Date: Mon, 8 Oct 2018 08:25:34 +0800 Subject: [PATCH] - ebai key changed. --- platformapi/ebaiapi/ebaiapi_test.go | 4 ++-- platformapi/ebaiapi/order_test.go | 16 +++++++++++++++- platformapi/ebaiapi/shop_sku.go | 7 +++---- platformapi/ebaiapi/shop_sku_test.go | 11 +++++++---- 4 files changed, 27 insertions(+), 11 deletions(-) diff --git a/platformapi/ebaiapi/ebaiapi_test.go b/platformapi/ebaiapi/ebaiapi_test.go index cd02e5f1..ca92c7e9 100644 --- a/platformapi/ebaiapi/ebaiapi_test.go +++ b/platformapi/ebaiapi/ebaiapi_test.go @@ -12,7 +12,7 @@ import ( ) const ( - testShopBaiduID = 2233043816 + testShopBaiduID = 2233909607 testShopID = "100077" ) @@ -27,7 +27,7 @@ func init() { baseapi.Init(sugarLogger) // sandbox - api = New("63032", "8c8b66720b69ae85") + api = New("62923", "aa4cdc6c1108486b") // prod // api = New("source", "secret") } diff --git a/platformapi/ebaiapi/order_test.go b/platformapi/ebaiapi/order_test.go index 6e63a015..6f323d5c 100644 --- a/platformapi/ebaiapi/order_test.go +++ b/platformapi/ebaiapi/order_test.go @@ -7,10 +7,24 @@ import ( ) func TestOrderGet(t *testing.T) { - result, err := api.OrderGet("15380342248732") + result, err := api.OrderGet("15381031350154") if err != nil { t.Fatal(err) } else { t.Log(utils.Format4Output(result, false)) } } + +func TestOrderCallDelivery(t *testing.T) { + err := api.OrderCallDelivery("15381031350154") + if err != nil { + t.Fatal(err) + } +} + +func TestOrderSendOut(t *testing.T) { + err := api.OrderSendOut("15381031350154", "") + if err != nil { + t.Fatal(err) + } +} diff --git a/platformapi/ebaiapi/shop_sku.go b/platformapi/ebaiapi/shop_sku.go index 9f1819e0..d813d6e6 100644 --- a/platformapi/ebaiapi/shop_sku.go +++ b/platformapi/ebaiapi/shop_sku.go @@ -117,12 +117,11 @@ func (a *API) SkuCreate(shopID string, customSkuID int, params map[string]interf KeyShopID: shopID, "custom_sku_id": customSkuID, "upc_type": UPCTypePrivate, - "upc": customSkuID, "brand_name": "无", // 很狗血的是,你还必须填个无才行。。。 } - // if params["upc"] == nil { - // defParams["upc"] = "upc-" + utils.Int2Str(customSkuID) - // } + if params["upc"] == nil { + defParams["upc"] = "upc-" + utils.Int2Str(customSkuID) + } if params["brand_id"] == nil { defParams["brand_id"] = 0 } diff --git a/platformapi/ebaiapi/shop_sku_test.go b/platformapi/ebaiapi/shop_sku_test.go index 504fda34..28756fc3 100644 --- a/platformapi/ebaiapi/shop_sku_test.go +++ b/platformapi/ebaiapi/shop_sku_test.go @@ -32,14 +32,14 @@ func TestShopCategoryUpdate(t *testing.T) { } func TestShopCategoryDelete(t *testing.T) { - err := api.ShopCategoryDelete(testShopID, 153760292217132) + err := api.ShopCategoryDelete(testShopID, 1538315352106929) if err != nil { t.Fatal(err) } } func TestSkuGetItemsByCategoryId(t *testing.T) { - result, err := api.SkuGetItemsByCategoryId(testShopID, 0) + result, err := api.SkuGetItemsByCategoryId(testShopID, 153838813210900) if err != nil { t.Fatal(err) } else { @@ -48,7 +48,10 @@ func TestSkuGetItemsByCategoryId(t *testing.T) { } func TestSkuList(t *testing.T) { - result, err := api.SkuList(testShopID, nil) + result, err := api.SkuList(testShopID, map[string]interface{}{ + // "sku_id": 15381031761764456, + // "delete": 1, + }) if err != nil { t.Fatal(err) } else { @@ -57,7 +60,7 @@ func TestSkuList(t *testing.T) { } func TestSkuCreate(t *testing.T) { - result, err := api.SkuCreate(testShopID, 116, map[string]interface{}{ + result, err := api.SkuCreate(testShopID, 10, map[string]interface{}{ "name": "测试商品", "status": SkuStatusOnline, "left_num": MaxLeftNum,