文档
测试

向购物车中添加商品

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

请求参数

参数名
类型
描述
必填
productID
Integer
商品ID
必填
count
Integer
添加商品数量
必填
type
Integer
添加类型
必填

响应参数

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

成功的返回示例

{ "status": 200, "data": { "cartProductVOList": [ { "id": 125, "userId": 23, "productId": 10004, "quantity": 20, "productName": "方法是", "productSubtitle": "4", "productMainImage": "4", "productPrice": 4, "productStatus": 1, "productStock": 100, "productTotalPrice": 80, "productChecked": 1, "limitQuantity": "SUCCESS" }, { "id": 128, "userId": 23, "productId": 10000, "quantity": 4, "productName": "苹果", "productSubtitle": "1", "productMainImage": "1", "productPrice": 1, "productStatus": 1, "productStock": 100, "productTotalPrice": 4, "productChecked": 1, "limitQuantity": "SUCCESS" } ], "allChecked": true, "cartTotalPrice": 84 } }

失败的返回示例1

{ "status": 4, "msg": "商品不存在" }

失败的返回示例2

{ "status": 100, "msg": "用户未登录" }

失败的返回示例3

{ "status": 5, "msg": "超出库存数量" }

失败的返回示例4

{ "status": 10, "msg": "添加类型参数错误" }

失败的返回示例5

{ "status": 3, "msg": "非法参数" }