1.发布订单
Request:
method: POST
api/v1.0/orders
{
"house_id": "1",
"start_date": "2017-11-11 21:23:49",
"end_date": "2017-11-12 21:23:49",
}
Response
返回成功:
{
"errno": "0",
"errmsg": "成功",
"data": {
"order_id":"1"
}
}
失败:
{
"errno": "400x", //状态码
"errmsg":"状态错误信息"
}
2.请求查看房东/租客订单信息
Request:
method: GET
api/v1.0/user/orders?role=custom 备注:role=custom为租客查看订单信息
api/v1.0/user/orders?role=landlord 备注:role=landlord为房东查看被预定订单信息
no input data
Response
返回成功:
{
"errno": "0",
"errmsg": "成功",
"data": {
"orders": [
{
"amount": 200,
"comment": "哈哈拒接",
"ctime": "2017-11-11 21:23:49",
"days": 2,
"end_date": "2017-11-29 16:00:00",
"img_url": "http://101.200.170.171:9998/group1/M00/00/00/Zciqq1oBJY-AL3m8AAS8K2x8TDE052.jpg",
"order_id": 3,
"start_date": "2017-11-28 16:00:00",
"status": "REJECTED",//WAIT_ACCPET,WAIT_COMMENT,REJECTED,COMPLETE,CANCELED
"title": "上奥世纪中心"
},
{
"amount": 1500,
"comment": "",
"ctime": "2017-11-11 01:32:10",
"days": 15,
"end_date": "2017-11-24 16:00:00",
"img_url": "http://101.200.170.171:9998/group1/M00/00/00/Zciqq1oBJY-AL3m8AAS8K2x8TDE052.jpg",
"order_id": 2,
"start_date": "2017-11-10 16:00:00",
"status": "WAIT_COMMENT",
"title": "上奥世纪中心"
},
{
"amount": 300,
"comment": "",
"ctime": "2017-11-10 01:46:00",
"days": 3,
"end_date": "2017-11-11 16:00:00",
"img_url": "http://101.200.170.171:9998/group1/M00/00/00/Zciqq1oBJY-AL3m8AAS8K2x8TDE052.jpg",
"order_id": 1,
"start_date": "2017-11-09 16:00:00",
"status": "WAIT_COMMENT",
"title": "上奥世纪中心"
}
]
}
}
失败:
{
"errno": "400x", //状态码
"errmsg":"状态错误信息"
}
3.房东同意/拒绝订单
api/v1.0/orders/4/status
Request:
method: PUT
api/v1.0/orders/4/status 备注: 表示 订单ID
{action: "accept"} //"accept", "reject"
Response
返回成功:
{
"errno": "0",
"errmsg": "成功"
}
失败:
{
"errno": "400x", //状态码
"errmsg":"状态错误信息"
}
4.用户评价订单信
Request:
method: PUT
api/v1.0/orders/2/comment 备注:2 表示 订单ID
{
order_id: "2",
comment: "烂房子!"
}
Response
返回成功:
{
"errno": "0",
"errmsg": "成功"
}
失败:
{
"errno": "400x", //状态码
"errmsg":"状态错误信息"
}