OpSkuParam.Upc json to upcCode
This commit is contained in:
@@ -184,7 +184,7 @@ type OpSkuParam struct {
|
||||
IsSale int `json:"-"` // 创建:0,1可售,-1不可售,更新:0忽略,1可售,-1不可售
|
||||
DontUseThisFieldDirectlyIsSale bool `json:"isSale"` // 门店商品可售状态(true/false);新建商品时,如果为true,门店商品可售状态初始为可售,如果为false, 门店商品可售状态初始为不可售。后续修改各个门店商品可售状态时,请使用根据京东到家商品编码批量修改门店商品可售状态接口。
|
||||
|
||||
Upc string `json:"upc,omitempty"` // UPC编码(商品条码),限1-35个字符,包装类的商品要求UPC编码必填,且要符合条码编写的校验,否则商品会不予通过,接口返回错误状态码code为10059。
|
||||
Upc string `json:"upcCode,omitempty"` // TODO 老版与新版接口参数不一致,UPC编码(商品条码),限1-35个字符,包装类的商品要求UPC编码必填,且要符合条码编写的校验,否则商品会不予通过,接口返回错误状态码code为10059。
|
||||
Images []string `json:"images,omitempty"`
|
||||
ProductDesc string `json:"productDesc,omitempty"`
|
||||
IfViewDesc int `json:"ifViewDesc"`
|
||||
|
||||
@@ -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), ¶m)
|
||||
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{
|
||||
|
||||
Reference in New Issue
Block a user