web开发实战(api设计)

1、登录
/login/do_login post(代码需要post方式请求),开放get,方便调试
request
mobile,password
response
fail
{
“status”: 500100,
“msg”: “服务端异常”
}
success
{
“status”: 0
}
2、商品接口
2.1商品列表接口
/goods/ to_list post(代码需要post方式请求),开放get,方便调试
request
{
}
response
{
“goodsName”:huawei,
“goodsImg”: “图片”
“goodsPrice”: “4968”
“miaoshaPric”: “0.01”
“stockCount”: “55”
“id”: “4567895”
}
2.2商品详情接口
request
{
“goodsId”:1
}
response
{
“startDate”:20200101,
“goodsName”: “huawei”
“goodsImg”: “图片”
“goodsPrice”: “4641”
“miaoshaPrice”: “0.01”
“stockCount”: “13”
“id”:4646
“miaoshaStatus”:0
“remainSeconds”:200
}
3 秒杀接口
3.1秒杀
request
{
“goodsId”:1
}
response
{
“goodsName”:huawei,
“goodsImg”: “图片”
“goodsPrice”: “4641”
“createDate”: “20200101”
“status”: “1”
}
订单状态
0未支付、1待发货、2已发货、3已收货、4已退款、5已完成

你可能感兴趣的:(web开发实战(api设计))