文档
测试

修改商品

POST
/mall/admin/goods/update

请求头

参数名
类型
描述
必填
token
String
必填

请求参数

参数名
类型
描述
必填
goods
Object
商品信息
必填
id
int
商品ID
必填
goodsSn
String
商品编号
必填
name
String
商品名称
必填
brandId
int
系列id
必填
gallery
array
宣传画廊 图片数组
必填
keywords
String
关键字
必填
brief
String
商品简介
必填
isOnSale
Boolean
是否在售 true 在售
必填
sortOrder
int
排序编号
必填
picUrl
String
商品图片
必填
isNew
int
是否为新品 true 是
必填
isHot
int
是否热门推荐 true 是
必填
unit
String
商品单位 件/套/个
必填
counterPrice
float
专柜价格
必填
retailPrice
float
零售价格
必填
detail
String
商品详细介绍
必填
goodsType
int
商品类型 1 普通商品 2 预售商品 3 VIP商品
必填
firstPrice
float
定金,只有商品类型为 预售商品才有
必填
lastPrice
float
尾款,只有商品类型为 预售商品才有
必填
isFreeMall
int
是否包邮 true包邮 false不包邮
必填
freight
float
是否包邮 2 到付 1 包邮 0 不包邮
必填
closeTimeUnit
int
未付尾款超时时间单位 1: 天 2: 小时 3: 分钟
必填
depositIsRefund
int
预售商品 定金是否可退款 1 可退款 2 不可退款
必填
products
array
商品库存信息 数组
必填
id
int
商品库存id 如果这个参数为空 就是新增 商品货品操作,不为空就是 修改商品货品操作
必填
specification
String
商品规格值 例如 尺寸: X XL
必填
number
int
库存数量
必填
url
String
商品图片
必填

响应参数

参数名
类型
描述
必填
code
int
0成功 其他失败
必填
msg
String
响应信息
必填

说明 / 示例

#### 接口旧参数值: ##### 参数说明 |参数|说明| |-|-| |goods| 商品信息| |specifications| 商品规格信息,数组格式| |products| 商品库存信息,数组格式| |attributes| 商品参数信息,数组格式| ```java { "goods": { "id": 999, "picUrl": "http://122.51.199.160:8080/wx/storage/fetch/e817yeci47k0t7sr4gyz.jpg", "gallery": [ "http://122.51.199.160:8080/wx/storage/fetch/d2vngcwgyrc8jiiqeep9.jpg" ], "isHot": false, "isNew": true, "isOnSale": true, "goodsSn": "测试", "name": "测试名称", "counterPrice": "1", "unit": "套", "keywords": "123123", "brief": "商品简洁", "detail": "<p>商品介绍</p>" }, "specifications": [ { "specification": "xl", "value": "xl", "picUrl": "http://122.51.199.160:8080/wx/storage/fetch/d0i3n1evegderhn704qh.jpg" } ], "products": [ { "specifications": [ "xl" ], "price": "100", "number": "100", "url": "http://122.51.199.160:8080/wx/storage/fetch/i39l8zlmsg0c0w1t5igb.jpg" } ], "attributes": [] } ``` ### 接口调整后参数 |参数|说明| |-|-| |goods| 商品信息| |products| 商品库存信息,数组格式| ==products参数下新增一个属性specification表示规格,specifications数组形式已废弃== ==goods新增三个参数,goodsType、firstPrice、lastPrice== `请求示例` ```java { "goods": { "id":1181013, "goodsSn": "修改编号wwww", "name": "9527", "brandId": 1001000, "gallery": [ "http://122.51.199.160:8080/wx/storage/fetch/pb2y9v7iprvtag9o04ho.jpg", "http://122.51.199.160:8080/wx/storage/fetch/ts68800dldj1ioblncze.jpg" ], "keywords": null, "brief": "简洁", "isOnSale": true, "sortOrder": 100, "picUrl": "http://122.51.199.160:8080/wx/storage/fetch/zg6pzvawdst49vxbhzcm.jpg", "isNew": true, "isHot": false, "unit": "套", "counterPrice": 123123, "retailPrice": 123, "detail": "<p>123123</p>" }, "products": [ { "id":262, // 有id 就是修改操作 "specification" : "11111码", "number": 1, "url": "http://122.51.199.160:8080/wx/storage/fetch/9ntrfnud8cml2r86qc27.jpg" }, { // 没有id就是新增操作 "specification" : "ppppppppppppppppp码", "number": 1, "url": "http://122.51.199.160:8080/wx/storage/fetch/9ntrfnud8cml2r86qc27.jpg" } ] } ``` `返回示例` ```java { "code": 0, "msg": "请求成功" } ```