From 8cef64a577429ed09b55c8b853f2eb53c2380242 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Fri, 26 Jan 2024 16:25:09 +0800 Subject: [PATCH] 1 --- platformapi/ebaiapi/shop_sku.go | 5 ---- platformapi/ebaiapi/shop_sku_test.go | 39 ++++++++++++---------------- 2 files changed, 17 insertions(+), 27 deletions(-) diff --git a/platformapi/ebaiapi/shop_sku.go b/platformapi/ebaiapi/shop_sku.go index eb7b90c7..3bff2fd4 100644 --- a/platformapi/ebaiapi/shop_sku.go +++ b/platformapi/ebaiapi/shop_sku.go @@ -2,7 +2,6 @@ package ebaiapi import ( "fmt" - "git.rosy.net.cn/jx-callback/globals" "regexp" "strings" @@ -322,10 +321,6 @@ func (a *API) SkuList(shopID string, params *SkuListParams) (skuInfo *PageDataIn // 饿百商品名可以相同,不会报错 func (a *API) SkuCreate(trackInfo, shopID string, customSkuID int64, params map[string]interface{}) (skuID int64, err error) { - globals.SugarLogger.Debugf("======== %s", trackInfo) - globals.SugarLogger.Debugf("======== %s", shopID) - globals.SugarLogger.Debugf("======== %d", customSkuID) - globals.SugarLogger.Debugf("======== %s", utils.Format4Output(params, false)) defParams := map[string]interface{}{ KeyShopID: shopID, KeyCustomSkuID: customSkuID, diff --git a/platformapi/ebaiapi/shop_sku_test.go b/platformapi/ebaiapi/shop_sku_test.go index da4ca268..6e303405 100644 --- a/platformapi/ebaiapi/shop_sku_test.go +++ b/platformapi/ebaiapi/shop_sku_test.go @@ -72,28 +72,23 @@ func TestSkuUploadRTF(t *testing.T) { } func TestSkuCreate(t *testing.T) { - result, err := api.SkuCreate("", testShopID, 17, map[string]interface{}{ - "name": "测试商品", - "status": SkuStatusOnline, - "left_num": MaxLeftNum, - "sale_price": 100, - "market_price": 100, - "cat1_id": 151301831158987, - "cat2_id": 15347484581335, - "cat3_id": 15347484581339, - "encrypt": "", - "sign": "A97439C8B502BB7197EC7E5CED53C158", - "source": "34665", - "ticket": "E700820C-8FDC-4A8B-A920-38ACAA01C332", - "timestamp": 1639390432, - "traceid": "0bc5f41d16393904320001232e5843", - "version": "3", - "photos": []map[string]interface{}{ - map[string]interface{}{ - "is_master": 1, - "url": "http://image.jxc4.com/8536c76779333f53517006f88ea7174c.jpg?imageView2/1/w/80/h/80", - }, - }, + result, err := api.SkuCreate("DD1445C6BC2011EEB00C525400E86DC0", "800437", 20240085, map[string]interface{}{ + "cat3_id": 201218221, + "category_id": 201217436, + "left_num": 9999, + "minimum": 1, + "name": "【新品上市】新鲜 洗净智利进口车厘子 500g(JJ)", + "photos": map[string]interface{}{ + "is_master": 1, + "url": "https://img.alicdn.com/imgextra/i4/1/O1CN011UdvjE1BsVJlGQ4ok_!!1-0-tcretail.jpg"}, + "preparation_time": 0, + "process_type": 0, + "rtf": "https://img.alicdn.com/imgextra/desc/icoss!0764993629621!13916222277", + "sale_price": 13200, + "seven_days_no_reason": false, + "status": "1", + "upc": "3004279768217", + "weight": "500", }) if err != nil { t.Fatal(err)