From 6df9d6fb75f4fa2c4eb49106c73f74ad29dd0d58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Wed, 20 May 2020 11:47:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=AC=E4=B8=9C=E5=95=86=E5=9F=8E=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=8C=E5=88=A0=E9=99=A4sku=E8=A7=84=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platformapi/jdshopapi/sku.go | 9 +++++++++ platformapi/jdshopapi/sku_test.go | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/platformapi/jdshopapi/sku.go b/platformapi/jdshopapi/sku.go index 048188f0..fd146013 100644 --- a/platformapi/jdshopapi/sku.go +++ b/platformapi/jdshopapi/sku.go @@ -480,3 +480,12 @@ func (a *API) UpdateSkus(updateSkusParam *UpdateSkusParam) (vendorSkuID string, } return vendorSkuID, err } + +//删除sku +//https://open.jd.com/home/home#/doc/api?apiCateId=48&apiId=1323&apiName=jingdong.sku.write.deleteSku +func (a *API) DeleteSku(skuId int64) (err error) { + _, err = a.AccessAPI2("jingdong.sku.write.deleteSku", prodURL, map[string]interface{}{ + "skuId": skuId, + }) + return err +} diff --git a/platformapi/jdshopapi/sku_test.go b/platformapi/jdshopapi/sku_test.go index 7a495f91..1487e5a3 100644 --- a/platformapi/jdshopapi/sku_test.go +++ b/platformapi/jdshopapi/sku_test.go @@ -352,3 +352,11 @@ func TestUpdateSkus(t *testing.T) { t.Fatal(err) } } + +func TestDeleteSku(t *testing.T) { + err := api.DeleteSku(69570857055) + if err != nil { + t.Fatal(err) + } + // t.Log(utils.Format4Output(result, false)) +}