文档
测试

购物车添加商品

POST
http://localhost:8080/portal/cart/add.do

请求参数

参数名
类型
描述
必填
productId
Integer
商品ID
必填
count
Integer
数量
必填
type
Integer
0-图片添加 购物车使用加减器 1-购物车直接给数值
必填

响应参数

参数名
类型
描述
必填
status
Integer
状态码
必填
data
T
数据
必填
username
String
登录成功后的管理员用户名
必填
msg
String
状态信息
必填

成功的返回示例

{ "status": 200, "data": { "cartProductVos": [ { "id": 125, "userId": 21, "productId": null, "quantity": 5, "productSubtitle": "4", "productMainImage": "4", "productPrice": 4, "productStock": 60, "productStatus": 1, "productTotalPrice": 20, "productChecked": 1, "limitQuantity": "LIMIT_NUM_SUCCESS", "productName": "方法是" }, { "id": 128, "userId": 21, "productId": null, "quantity": 1, "productSubtitle": "1", "productMainImage": "1", "productPrice": 1, "productStock": 100, "productStatus": 1, "productTotalPrice": 1, "productChecked": 1, "limitQuantity": "LIMIT_NUM_SUCCESS", "productName": "苹果" }, { "id": 129, "userId": 21, "productId": null, "quantity": 3, "productSubtitle": "3", "productMainImage": "3", "productPrice": 3, "productStock": 100, "productStatus": 1, "productTotalPrice": 9, "productChecked": 1, "limitQuantity": "LIMIT_NUM_SUCCESS", "productName": "搜索" } ], "allChecked": true, "cartTotalPrice": 30 } }

失败的返回示例

{ "status": 3, "msg": "参数不能为空" } { "status": 4, "msg": "超出库存" }