响应参数
参数名 参数说明 备注total 总共商品条数
pagenum 当前商品页数
goods_id 商品 ID
goods_name 商品名称
goods_price 价格
goods_number 数量
goods_weight 重量 不能为空
goods_state 商品状态 商品状态 0: 未通过 1: 审核中 2: 已审核
add_time 添加时间
upd_time 更新时间
hot_mumber 热销品数量
is_promote 是否是热销品
pics 上传的图片临时路径(对象) pics_id:图片 ID,goods_id:商品 ID,pics_big:大图,pics_mid:中图,pics_sma:小图
attrs 商品的参数(数组) goods_id:商品 ID,attr_value:当前商品的参数值,add_price:浮动价格,attr_vals:预定义的参数值,attr_sel:手动输入,还是单选,
响应数据
{ "data": { "goods_id": 145, "goods_name": "test_goods_name2", "goods_price": 20, "goods_number": 30, "goods_weight": 40, "goods_introduce": "abc", "goods_big_logo": "", "goods_small_logo": "", "goods_state": 1, "add_time": 1512962370, "upd_time": 1512962370, "hot_mumber": 0, "is_promote": false, "pics": [ { "pics_id": 397, "goods_id": 145, "pics_big": "uploads/goodspics/big_30f08d52c551ecb447277eae232304b8", "pics_mid": "uploads/goodspics/mid_30f08d52c551ecb447277eae232304b8", "pics_sma": "uploads/goodspics/sma_30f08d52c551ecb447277eae232304b8" } ], "attrs": [ { "goods_id": 145, "attr_id": 15, "attr_value": "ddd", "add_price": null, "attr_name": "fffffff", "attr_sel": "many", "attr_write": "list", "attr_vals": "" }, { "goods_id": 145, "attr_id": 15, "attr_value": "eee", "add_price": null, "attr_name": "fffffff", "attr_sel": "many", "attr_write": "list", "attr_vals": "" } ] }, "meta": { "msg": "创建商品成功", "status": 201 } } 1.8.4. 编辑提交商品请求路径:goods/:id
请求方法:put
请求参数
参数名 参数说明 备注id 商品 ID 不能为空携带在url中
goods_name 商品名称 不能为空
goods_price 价格 不能为空
goods_number 数量 不能为空
goods_weight 重量 不能为空
goods_introduce 介绍 可以为空
pics 上传的图片临时路径(对象) 可以为空
attrs 商品的参数(数组) 可以为空
请求数据
{ "goods_name":"test_goods_name2", "goods_price":20, "goods_number":30, "goods_weight":40, "goods_introduce":"abc", "pics":[ {"pic":"/tmp_uploads/30f08d52c551ecb447277eae232304b8"} ], "attrs":[ { "attr_id":15, "attr_value":"ddd" }, { "attr_id":15, "attr_value":"eee" } ] }