京东商城依稀下列

This commit is contained in:
苏尹岚
2020-05-13 09:41:55 +08:00
parent 35cd9ffa79
commit 8be594e91d
3 changed files with 92 additions and 43 deletions

View File

@@ -134,23 +134,23 @@ func TestCreateSku(t *testing.T) {
var attrs2 []*CreateSkuParamAttrs
var attrs3 []*CreateSkuParamAttrs
ware := &CreateSkuParamWare{
Title: "测试商品1",
ShopCategorys: []int{11},
CategoryID: 13577,
TransportID: TransportID,
MobileDesc: "测试",
Introduction: "测试",
WareStatus: 8,
OuterID: "1",
Weight: 2300,
Height: 100,
Length: 100,
Width: 100,
JdPrice: 20,
MarketPrice: 10,
VenderID: 0,
BrandID: JxBrandId,
Is7ToReturn: 0,
Title: "测试商品1",
// ShopCategorys: []int{11},
CategoryID: 13577,
TransportID: TransportID,
MobileDesc: "测试",
Introduction: "测试",
WareStatus: 8,
OuterID: "1",
Weight: 2300,
Height: 100,
Length: 100,
Width: 100,
JdPrice: 20,
MarketPrice: 10,
VenderID: 0,
BrandID: JxBrandId,
Is7ToReturn: 0,
}
image := &CreateSkuParamImages{
ColorID: "0000000000",
@@ -164,12 +164,14 @@ func TestCreateSku(t *testing.T) {
StockNum: 1,
Type: "com.jd.pop.ware.ic.api.domain.sku",
Type2: "com.jd.pop.ware.ic.api.domain.Sku",
OuterID: "1",
}
sku2 := &CreateSkuParamSkus{
JdPrice: 10,
StockNum: 1,
Type: "com.jd.pop.ware.ic.api.domain.sku",
Type2: "com.jd.pop.ware.ic.api.domain.Sku",
OuterID: "2",
}
attr1 := &CreateSkuParamAttrs{
AttrID: "109692",
@@ -206,6 +208,7 @@ func TestCreateSku(t *testing.T) {
sku.SaleAttrs = attrs2
skus = append(skus, sku)
skus = append(skus, sku2)
// ware.Skus = skus
result, err := api.CreateWare(ware, skus)
if err != nil {
t.Fatal(err)
@@ -214,23 +217,24 @@ func TestCreateSku(t *testing.T) {
}
func TestFindAttrs(t *testing.T) {
err := api.FindAttrs(13577)
result, err := api.FindAttrs(13577)
if err != nil {
t.Fatal(err)
}
// t.Log(utils.Format4Output(result, false))
t.Log(utils.Format4Output(result, false))
}
func TestFindValuesByAttrId(t *testing.T) {
err := api.FindValuesByAttrId(109692)
result, no, err := api.FindValuesByAttrId(109692)
if err != nil {
t.Fatal(err)
}
// t.Log(utils.Format4Output(result, false))
t.Log(utils.Format4Output(result, false))
fmt.Println(no)
}
func TestSaveVenderAttrValue(t *testing.T) {
err := api.SaveVenderAttrValue("0.5", 160806, 13571, 1)
err := api.SaveVenderAttrValue("100g", 1001027606, 13577, 2)
if err != nil {
t.Fatal(err)
}