From 975305a32de10ada81edd609a839e77114af91bd Mon Sep 17 00:00:00 2001 From: gazebo Date: Wed, 4 Sep 2019 11:44:31 +0800 Subject: [PATCH] + jdapi.AddByStoreAndSkus --- platformapi/jdapi/order_test.go | 7 +++++++ platformapi/jdapi/store_sku.go | 13 +++++++++++++ 2 files changed, 20 insertions(+) diff --git a/platformapi/jdapi/order_test.go b/platformapi/jdapi/order_test.go index c9a33b52..2513f0ee 100644 --- a/platformapi/jdapi/order_test.go +++ b/platformapi/jdapi/order_test.go @@ -244,3 +244,10 @@ func TestGetByOrderNoForOaos(t *testing.T) { t.Fatal(err.Error()) } } + +func TestCheckSelfPickCode(t *testing.T) { + err := api.CheckSelfPickCode("", "921241806000842", "test") + if err != nil { + t.Fatal(err.Error()) + } +} diff --git a/platformapi/jdapi/store_sku.go b/platformapi/jdapi/store_sku.go index 25e12752..45dd44e9 100644 --- a/platformapi/jdapi/store_sku.go +++ b/platformapi/jdapi/store_sku.go @@ -9,6 +9,8 @@ import ( const ( MaxStoreSkuBatchSize = 50 MaxStockQty = 100000000 + + MaxAddByStoreAndSkusCount = 30 // 批量置顶商品排序接口的最大个数 ) type SkuPriceInfo struct { @@ -293,3 +295,14 @@ func (a *API) QueryStockCenter(outStationNo string, skuIds []*SkuIdEntity, userP } return vendibilityResponse, err } + +// 批量置顶商品排序接口 +// https://opendj.jd.com/staticnew/widgets/resources.html?groupid=180&apiid=a7677f1a75984ed3a6ea3d4827f5a6b4 +func (a *API) AddByStoreAndSkus(stationNo int64, skuIDs []int64) (err error) { + jdParams := map[string]interface{}{ + "storeId": stationNo, + "skuIds": skuIDs, + } + _, err = a.AccessAPINoPage("OrgSortService/addByStoreAndSkus", jdParams, nil, nil, genNoPageResultParser("status", "message", "", "200")) + return err +}