- remove useless param cagtegoryId, shopCategories and brandId for jdapi.AppendSku
This commit is contained in:
@@ -462,25 +462,22 @@ func (a *API) AddSpu(outSpuId string, cagtegoryId int, shopCategories []int64, b
|
|||||||
|
|
||||||
// 追加新的SKU到指定的SPU接口
|
// 追加新的SKU到指定的SPU接口
|
||||||
// https://opendj.jd.com/staticnew/widgets/resources.html?groupid=180&apiid=cffb839b06f042b28d6397b6bd4f2676
|
// 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)
|
attr := specAttr //getSkuAttr(weight)
|
||||||
if err = a.AppendSpuSaleAttr(outSpuId, "1001", attr); err != nil {
|
if err = a.AppendSpuSaleAttr(outSpuId, "1001", attr); err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
fixedParams := map[string]interface{}{
|
fixedParams := map[string]interface{}{
|
||||||
KeyOutSpuId: outSpuId,
|
KeyOutSpuId: outSpuId,
|
||||||
KeyOutSkuId: outSkuId,
|
KeyOutSkuId: outSkuId,
|
||||||
KeyCategoryId: cagtegoryId,
|
KeySkuName: skuName,
|
||||||
KeyShopCategories: shopCategories,
|
KeySkuPrice: skuPrice,
|
||||||
KeyBrandId: brandId,
|
KeyWeight: weight,
|
||||||
KeySkuName: skuName,
|
KeyImages: images,
|
||||||
KeySkuPrice: skuPrice,
|
KeyFixedStatus: fixedStatus,
|
||||||
KeyWeight: weight,
|
KeyIsSale: isSale,
|
||||||
KeyImages: images,
|
"saleAttrValues": genAttrMapList(attr),
|
||||||
KeyFixedStatus: fixedStatus,
|
|
||||||
KeyIsSale: isSale,
|
|
||||||
"saleAttrValues": genAttrMapList(attr),
|
|
||||||
}
|
}
|
||||||
result, err := a.AccessAPINoPage("pms/appendSku", utils.MergeMaps(fixedParams, addParams), nil, nil, nil)
|
result, err := a.AccessAPINoPage("pms/appendSku", utils.MergeMaps(fixedParams, addParams), nil, nil, nil)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user