OpSkuParam.Upc json to upcCode

This commit is contained in:
gazebo
2019-12-13 15:16:56 +08:00
parent fd42a483d9
commit 17c4265ea4
2 changed files with 35 additions and 1 deletions

View File

@@ -133,6 +133,14 @@ func TestGetProductStatust(t *testing.T) {
}
}
func TestAddShopCategory(t *testing.T) {
result, err := api.AddShopCategory(0, "hello", 1, 0, "test")
if err != nil {
t.Fatal(err)
}
t.Log(result)
}
func TestDelShopCategory(t *testing.T) {
err := api.DelShopCategory(4784689)
if err != nil {
@@ -156,6 +164,32 @@ func TestGetSpuSaleAttr(t *testing.T) {
t.Log(utils.Format4Output(result, false))
}
func TestAddSku(t *testing.T) {
str := `
{"brandId":35247,
"categoryId":20847,
"fixedStatus":1,
"ifViewDesc":0,
"images":["http://image.jxc4.com/e42be71501d0fbb841743bfb7a9ebbcf.jpg"],
"isSale":false,
"outSkuId":"29935",
"shopCategories":[4247719],
"skuName":"黑2龙江冰宝珍珠米10kg/袋",
"skuPrice":7245,"traceId":"4414AEAD1CCA11EAB689525400E86DC0,xujianhua","weight":1}
`
var param *OpSkuParam
err := utils.UnmarshalUseNumber([]byte(str), &param)
if err != nil {
t.Fatal(err)
}
param.Upc = "6666000029935"
result, err := api.AddSku2(param)
if err != nil {
t.Fatal(err)
}
t.Log(utils.Format4Output(result, false))
}
func TestBatchAddSku(t *testing.T) {
paramList := []*CreateByUpcParam{
&CreateByUpcParam{