用户(id,用户名,密码,资料,余额,角色【系统用户1,管理员2,游客3】)
地址(id,用户名,地址, 是否默认)
商品(id,商品名称,商品类别,商品图片,商品详情,状态【上架,下架】,销量)
订单(id,用户名,商品id,状态【1-未付款,2-已付款,3-已取消】,开始时间,结束时间)
购物车(id,用户名,商品id, 数量)
mysql用户名root密码action123
request
字段 | 类型 | 解释 |
---|---|---|
username | string | |
password | string |
response
errno | int | 错误码,0表示无错误 |
data | User | 用户信息 |
request
username | string | |
password | string | |
checkpass | string | |
detail | string | 详细信息 |
role | int | 1系统用户2管理员3游客 |
response
errno | int | 错误码,0表示无错误 |
error | string | 错误描述 |
request
字段 | 类型 | 解释 |
---|---|---|
username | string | |
password | string | 原密码 |
newpass | string | 新密码 |
response
data | UserAndAddr | 用户信息+地址 |
request
uid | int | 用户id |
response
data | UserAndAddr | 用户信息+地址 |
user的结构
{
"id": 1,
"name": "dzy",
"pass": "123",
"detail": "hahahahaha",
"balance": 100.0,
"role": 1
}
UserAndAddr的结构
{
"id": 1,
"name": "dzy",
"pass": "321",
"detail": "hahahahaha",
"balance": 97.0,
"role": 1,
"addr": [
{
"id": 1,
"name": "dzy",
"addr": "testaddr1",
"isdefault": 1
},
{
"id": 2,
"name": "dzy",
"addr": "updaddr2",
"isdefault": 0
}
]
}
request
pageSize | int | 页大小 |
pageNum | int | 第几页 |
response
total | int | 商品总数 |
pageSize | int | 页大小 |
pageNum | int | 第几页 |
productList | Product数组 | 该页的商品 |
request
productType | string | 商品类型 |
pageSize | int | 页大小 |
pageNum | int | 第几页 |
response
total | int | 商品总数 |
pageSize | int | 页大小 |
pageNum | int | 第几页 |
productList | Product数组 | 该页的商品 |
request
productId | int | 商品id |
response
product | Product | 商品对象 |
request
不需要参数 |
response
typeList | string数组 | 所有的分类 |
Product
{
"id": 3,
"name": "name4",
"ptype": "type2",
"pic": "1.png, 2.png",
"detail": "detail",
"price": 3.0,
"status": 1,
"salecnt": 1
}
request
username | string | 用户名 |
pid | int | 商品id |
cnt | int | 商品数量 |
response
errno | int | 0成功1失败 |
request
idList | string | 选中要删除的商品的id,用逗号隔开 |
username | string | 用户名 |
response
errno | int | 0成功1失败 |
request
username | string | 用户名 |
idList | string | 选中商品的id,用逗号隔开 |
response
errno | int | 0成功1失败 |
request
username | string | 用户名 |
response 示例
[
{
"id": 1, // 购物车项id
"count": 2,
"product": {
"id": 3,
"name": "name4",
"ptype": "type2",
"pic": "1.png, 2.png",
"detail": "detail",
"price": 3.0,
"status": 1,
"salecnt": 1
}
},
{
"id": 2,
"count": 1,
"product": {
"id": 4,
"name": "name5",
"ptype": "type2",
"pic": "1.png, 2.png",
"detail": "detail",
"price": 3.0,
"status": 1,
"salecnt": 1
}
}
]
request
username | string | 用户名 |
response 实例
[
{
"orderId": 1,
"username": "dzy",
"product": {
"id": 3,
"name": "name4",
"ptype": "type2",
"pic": "1.png, 2.png",
"detail": "detail",
"price": 3.0,
"status": 1,
"salecnt": 1
},
"num": 2,
"status": 2, // 1-未支付 2-已支付 3-已取消
"startTime": "2020-12-31 16:23:34",
"endTime": "2020-12-31-19:57:49"
},
{
"orderId": 2,
"username": "dzy",
"product": {
"id": 4,
"name": "name5",
"ptype": "type2",
"pic": "1.png, 2.png",
"detail": "detail",
"price": 3.0,
"status": 1,
"salecnt": 1
},
"num": 1,
"status": 1,
"startTime": "2020-12-31 16:23:34",
"endTime": null
},
{
"orderId": 5,
"username": "dzy",
"product": {
"id": 5,
"name": "name6",
"ptype": "type3",
"pic": "1.png, 2.png",
"detail": "detail",
"price": 3.0,
"status": 1,
"salecnt": 1
},
"num": 1,
"status": 2,
"startTime": "2020-12-31-19:26:16",
"endTime": "2020-12-31-19:57:49"
}
]
request
username | int | 用户id |
response 示例
[
{
"id": 1,
"name": "dzy",
"addr": "testaddr1",
"isdefault": 1
},
{
"id": 2,
"name": "dzy",
"addr": "updaddr2",
"isdefault": 0
},
{
"id": 3,
"name": "dzy",
"addr": "testaddr3",
"isdefault": 0
}
]
request
username | int | 用户id |
addr | string | 新增的地址 |
response
errno | int | 0成功1失败 |
request
aid | int | 地址id |
response
errno | int | 0成功1失败 |
request
aid | int | 地址id |
addr | string | 新地址 |
response
errno | int | 0成功1失败 |
request
aid | int | 地址id |
username | string | 用户名 |
response
errno | int | 0成功1失败 |
request
productId | int | 商品id |
username | string | 用户名 |
cnt | int | 商品个数 |
response
errno | int | 0成功1失败 |
这里的支付是直接在商品页付款,相当于立即购买;而购物车中的结算是支付购物车中的选中项。
request
money | double | 充值金额 |
username | string | 用户名 |
response 示例
{
"id": 1,
"name": "dzy",
"pass": "321",
"detail": "hahahahaha",
"balance": 107.0,
"role": 1,
"addr": [
{
"id": 1,
"name": "dzy",
"addr": "testaddr1",
"isdefault": 1
},
{
"id": 2,
"name": "dzy",
"addr": "updaddr2",
"isdefault": 0
}
]
}
同 [商品展示 -> 热销商品展示 GET]
同 [商品展示 -> 商品详情 GET]
request
product | Product | 商品对象,其中的id属性为要修改的商品id |
response
product | Product | 新增的product对象 |
request
product | Product | 商品对象,其中的id属性为要修改的商品id |
response
product | Product | 更新后的product对象 |
request
productId | int | 商品id |
stat | int | 1上架0下架 |
response
product | Product | 更新后的product对象 |