京东商城增加商品规格

This commit is contained in:
苏尹岚
2020-05-20 10:39:49 +08:00
parent 22c740f0f3
commit 33340fcfcb
2 changed files with 114 additions and 2 deletions

View File

@@ -230,7 +230,7 @@ func TestCreateSku(t *testing.T) {
}
func TestFindAttrs(t *testing.T) {
result, err := api.FindAttrs(13571)
result, err := api.FindAttrs(13573)
if err != nil {
t.Fatal(err)
}
@@ -238,7 +238,7 @@ func TestFindAttrs(t *testing.T) {
}
func TestFindValuesByAttrId(t *testing.T) {
result, no, err := api.FindValuesByAttrId(102242)
result, no, err := api.FindValuesByAttrId(1001027602)
if err != nil {
t.Fatal(err)
}
@@ -305,3 +305,50 @@ func TestImageUpdate(t *testing.T) {
}
// t.Log(utils.Format4Output(result, false))
}
func TestSearchWare4Valid(t *testing.T) {
result, err := api.SearchWare4Valid("红薯")
if err != nil {
t.Fatal(err)
}
t.Log(utils.Format4Output(result, false))
}
func TestUpdateSkus(t *testing.T) {
_, err := api.UpdateSkus(&UpdateSkusParam{
WareID: 14537944716,
Skus: []*UpdateSkusParamSkus{
&UpdateSkusParamSkus{
WareID: 14537944716,
JdPrice: 1.5,
StockNum: "99",
OuterID: "11",
SaleAttrs: []*CreateSkuParamAttrs{
&CreateSkuParamAttrs{
AttrID: "1001027602",
AttrValues: []string{"2440977935"},
},
},
Type: "com.jd.pop.ware.ic.api.domain.sku",
Type2: "com.jd.pop.ware.ic.api.domain.Sku",
},
&UpdateSkusParamSkus{
WareID: 14537944716,
JdPrice: 1.8,
StockNum: "99",
OuterID: "123",
SaleAttrs: []*CreateSkuParamAttrs{
&CreateSkuParamAttrs{
AttrID: "1001027602",
AttrValues: []string{"2441761921"},
},
},
Type: "com.jd.pop.ware.ic.api.domain.sku",
Type2: "com.jd.pop.ware.ic.api.domain.Sku",
},
},
})
if err != nil {
t.Fatal(err)
}
}