京东商城修改商品参数增加
This commit is contained in:
@@ -107,21 +107,22 @@ func TestGetFeightMb(t *testing.T) {
|
||||
|
||||
func TestAA(t *testing.T) {
|
||||
ware := &CreateSkuParamWare{
|
||||
Title: "测试商品1",
|
||||
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,
|
||||
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,
|
||||
}
|
||||
result, _ := json.Marshal(ware)
|
||||
fmt.Println(string(result))
|
||||
@@ -133,25 +134,36 @@ func TestCreateSku(t *testing.T) {
|
||||
var attrs []*CreateSkuParamAttrs
|
||||
var attrs2 []*CreateSkuParamAttrs
|
||||
var attrs3 []*CreateSkuParamAttrs
|
||||
var features []*CreateSkuParamFeatures
|
||||
feature := &CreateSkuParamFeatures{
|
||||
Key: "is7ToReturn",
|
||||
Value: "0",
|
||||
}
|
||||
features = append(features, feature)
|
||||
// desc = "aa"
|
||||
// desc := `<p>因生鲜比较脆弱,发货途中如果有磕碰损坏,请收到联系客服,闪电赔付。请核对好地址,发货后不可修改地址,因改地址导致损坏不能赔付,谢谢理解</p><p><img style="width:auto;height:auto;max-width:100%;" src="//img10.360buyimg.com/imgzone/jfs/t1/111969/32/6692/171733/5ebbb9daE5bedb5b2/38350dca19e2b9d2.jpg"><br></p><p><br></p>`
|
||||
desc := `<p>因生鲜比较脆弱,发货途中如果有磕碰损坏,请收到联系客服,闪电赔付。请核对好地址,发货后不可修改地址,因改地址导致损坏不能赔付,谢谢理解</p><p><img style="width:auto;height:auto;max-width:100%;" src="//img10.360buyimg.com/imgzone/jfs/t1/126814/22/1326/472568/5ebb888dEa2cfb5f6/c0c81db660994246.jpg"><br></p><p><br></p>`
|
||||
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,
|
||||
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,
|
||||
}
|
||||
ware.Features = features
|
||||
ware.MobileDesc = "aa"
|
||||
ware.Introduction = desc
|
||||
image := &CreateSkuParamImages{
|
||||
ColorID: "0000000000",
|
||||
ImgIndex: 1,
|
||||
@@ -217,7 +229,7 @@ func TestCreateSku(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestFindAttrs(t *testing.T) {
|
||||
result, err := api.FindAttrs(13577)
|
||||
result, err := api.FindAttrs(13571)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -225,7 +237,7 @@ func TestFindAttrs(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestFindValuesByAttrId(t *testing.T) {
|
||||
result, no, err := api.FindValuesByAttrId(109692)
|
||||
result, no, err := api.FindValuesByAttrId(102242)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -242,7 +254,27 @@ func TestSaveVenderAttrValue(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDeleteWare(t *testing.T) {
|
||||
err := api.DeleteWare(14509148757)
|
||||
err := api.DeleteWare(14518369562)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// t.Log(utils.Format4Output(result, false))
|
||||
}
|
||||
|
||||
func TestUpOrDown(t *testing.T) {
|
||||
err := api.UpOrDown(14518369562, 2)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// t.Log(utils.Format4Output(result, false))
|
||||
}
|
||||
|
||||
func TestUpdateWare(t *testing.T) {
|
||||
err := api.UpdateWare(&UpdateWareParam{
|
||||
WareID: 14521014949,
|
||||
Title: "大青菜1",
|
||||
VenderID: 10374877,
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user