- remove useless param cagtegoryId, shopCategories and brandId for jdapi.AppendSku

This commit is contained in:
gazebo
2019-01-29 09:04:46 +08:00
parent 2e6458e20a
commit 5a285296ab

View File

@@ -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 {