京东商城修改商品参数增加
This commit is contained in:
@@ -142,8 +142,9 @@ type CreateSkuResult struct {
|
||||
}
|
||||
|
||||
type UpdateWareParam struct {
|
||||
WareID int64 `json:"wareId"`
|
||||
Title string `json:"title"` //否 标题 商品名称 限制45个字符内
|
||||
WareID int64 `json:"wareId"`
|
||||
Title string `json:"title"` //否 标题 商品名称 限制45个字符内
|
||||
VenderID int64 `json:"venderId"`
|
||||
// Weight int `json:"weight"` //否 无 商品重量,单位kg
|
||||
}
|
||||
|
||||
@@ -255,9 +256,12 @@ func (a *API) GetAttrsByCategoryId(currPage, pageSize int) (err error) {
|
||||
//修改商品基础信息
|
||||
//https://open.jd.com/home/home#/doc/api?apiCateId=48&apiId=1380&apiName=jingdong.ware.write.updateWare
|
||||
func (a *API) UpdateWare(updateWareParam *UpdateWareParam) (err error) {
|
||||
result2, _ := json.Marshal(utils.Struct2FlatMap(updateWareParam))
|
||||
mapP := map[string]interface{}{
|
||||
"ware": updateWareParam,
|
||||
}
|
||||
result3, _ := json.Marshal(mapP)
|
||||
result, err := a.AccessAPI("jingdong.ware.write.updateWare", prodURL, map[string]interface{}{
|
||||
"ware": string(result2),
|
||||
"360buy_param_json": string(result3),
|
||||
})
|
||||
if err == nil {
|
||||
if result["jingdong_ware_write_updateWare_responce"].(map[string]interface{})["success"] != "success" {
|
||||
|
||||
Reference in New Issue
Block a user