From 5a285296abdf4ad3d3eba71d0e4d66fdf2483529 Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 29 Jan 2019 09:04:46 +0800 Subject: [PATCH] - remove useless param cagtegoryId, shopCategories and brandId for jdapi.AppendSku --- platformapi/jdapi/sku.go | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/platformapi/jdapi/sku.go b/platformapi/jdapi/sku.go index 28774b47..77a883bb 100644 --- a/platformapi/jdapi/sku.go +++ b/platformapi/jdapi/sku.go @@ -462,25 +462,22 @@ func (a *API) AddSpu(outSpuId string, cagtegoryId int, shopCategories []int64, b // 追加新的SKU到指定的SPU接口 // https://opendj.jd.com/staticnew/widgets/resources.html?groupid=180&apiid=cffb839b06f042b28d6397b6bd4f2676 -func (a *API) AppendSku(outSpuId string, outSkuId string, cagtegoryId int, shopCategories []int64, brandId int, skuName string, skuPrice int, weight float32, images []string, fixedStatus int, isSale bool, specAttr string, addParams map[string]interface{}) (skuID int64, err error) { +func (a *API) AppendSku(outSpuId string, outSkuId string, skuName string, skuPrice int, weight float32, images []string, fixedStatus int, isSale bool, specAttr string, addParams map[string]interface{}) (skuID int64, err error) { attr := specAttr //getSkuAttr(weight) if err = a.AppendSpuSaleAttr(outSpuId, "1001", attr); err != nil { return 0, err } fixedParams := map[string]interface{}{ - KeyOutSpuId: outSpuId, - KeyOutSkuId: outSkuId, - KeyCategoryId: cagtegoryId, - KeyShopCategories: shopCategories, - KeyBrandId: brandId, - KeySkuName: skuName, - KeySkuPrice: skuPrice, - KeyWeight: weight, - KeyImages: images, - KeyFixedStatus: fixedStatus, - KeyIsSale: isSale, - "saleAttrValues": genAttrMapList(attr), + KeyOutSpuId: outSpuId, + KeyOutSkuId: outSkuId, + KeySkuName: skuName, + KeySkuPrice: skuPrice, + KeyWeight: weight, + KeyImages: images, + KeyFixedStatus: fixedStatus, + KeyIsSale: isSale, + "saleAttrValues": genAttrMapList(attr), } result, err := a.AccessAPINoPage("pms/appendSku", utils.MergeMaps(fixedParams, addParams), nil, nil, nil) if err == nil {