文档
测试

保存购物车项

POST
http://localhost:8080/shopping/save

接口描述

保存购物车项, 请求体中的`items`表示购物车中的订单项(JSON字符串形式,需要前端parse解析或stringify转化),`total`为购物车总金额,`uid`为用户id。

请求参数

参数名
类型
描述
必填
uid
int
示例:1
必填
items
string
示例:"[{"id":1,"foodId":"30010002","foodName":"蓝莓麦芬","foodImage":"blueberry-muffin.jpg","price":"10.00","table":"food","count":3},{"id":1,"beverageId":"20080002","beverageName":"橘香茉吉托","beverageImage":"citrus-mint-mojito.jpg","type":1,"price":"10.00","table":"beverage","count":2},{"id":39,"beverageId":"40010001","beverageName":"星巴克?凤舞祥云综合咖啡豆","beverageImage":"south-of-the-clouds.jpg","type":2,"p...
必填
total
int
示例:80
必填

响应参数

参数名
类型
描述
必填
code
int
示例:0
必填
msg
string
示例:更改成功
必填
data
object
数据字典
必填
id
int
示例:2
必填
uid
int
示例:1
必填
items
string
示例:"[{"id":1,"foodId":"30010002","foodName":"蓝莓麦芬","foodImage":"blueberry-muffin.jpg","price":"10.00","table":"food","count":3},{"id":1,"beverageId":"20080002","beverageName":"橘香茉吉托","beverageImage":"citrus-mint-mojito.jpg","type":1,"price":"10.00","table":"beverage","count":2},{"id":39,"beverageId":"40010001","beverageName":"星巴克?凤舞祥云综合咖啡豆","beverageImage":"south-of-the-clouds.jpg","type":2,"p...
必填
total
string
示例:80.00
必填
status
object
示例:null
必填
createTime
object
示例:null
必填
updateTime
object
示例:null
必填

说明 / 示例

请求:http://localhost:8080/shopping/save 请求参数: { "uid": 1, "items": "\"[{\"id\":1,\"foodId\":\"30010002\",\"foodName\":\"蓝莓麦芬\",\"foodImage\":\"blueberry-muffin.jpg\",\"price\":\"10.00\",\"table\":\"food\",\"count\":3},{\"id\":1,\"beverageId\":\"20080002\",\"beverageName\":\"橘香茉吉托\",\"beverageImage\":\"citrus-mint-mojito.jpg\",\"type\":1,\"price\":\"10.00\",\"table\":\"beverage\",\"count\":2},{\"id\":39,\"beverageId\":\"40010001\",\"beverageName\":\"星巴克?凤舞祥云综合咖啡豆\",\"beverageImage\":\"south-of-the-clouds.jpg\",\"type\":2,\"price\":\"10.00\",\"table\":\"beverage\",\"count\":1},{\"id\":1,\"productId\":\"010010202\",\"productName\":\"橘香茉吉托\",\"productImage\":\"citrus-mint-mojito.jpg\",\"price\":\"10.00\",\"table\":\"selection\",\"count\":2}]\"", "total": 80 } 响应参数: { "code": 0, "msg": "更改成功", "data": { "id": 2, "uid": 1, "items": "\"[{\"id\":1,\"foodId\":\"30010002\",\"foodName\":\"蓝莓麦芬\",\"foodImage\":\"blueberry-muffin.jpg\",\"price\":\"10.00\",\"table\":\"food\",\"count\":3},{\"id\":1,\"beverageId\":\"20080002\",\"beverageName\":\"橘香茉吉托\",\"beverageImage\":\"citrus-mint-mojito.jpg\",\"type\":1,\"price\":\"10.00\",\"table\":\"beverage\",\"count\":2},{\"id\":39,\"beverageId\":\"40010001\",\"beverageName\":\"星巴克?凤舞祥云综合咖啡豆\",\"beverageImage\":\"south-of-the-clouds.jpg\",\"type\":2,\"price\":\"10.00\",\"table\":\"beverage\",\"count\":1},{\"id\":1,\"productId\":\"010010202\",\"productName\":\"橘香茉吉托\",\"productImage\":\"citrus-mint-mojito.jpg\",\"price\":\"10.00\",\"table\":\"selection\",\"count\":2}]\"", "total": "80.00", "status": null, "createTime": null, "updateTime": null } }