{
"user":"user",
"password":"password"
}
返回一个token,后面的请求的header需要添加Authorization: token
{
"success": true,
"msg": "",
"obj": "Basic token"
}
http POST请求
url: http://host:port/car_wash/v1/user
{
"user":{
"name":"zyx", //姓名
"phone":13788888888, //电话
"type":1, //类型
"restMoney":1000 //余额
"vehicleLicense": "苏J12345" //车牌
}
}
{
"success": true,
"msg": "",
"obj": ""
}
http GET请求
url: http://host:port/car_wash/v1/user
{
"success": true,
"msg": "",
"obj": [
{
"id": 3,
"name": "zyx",
"phone": 13788888888,
"type": 1,
"restMoney": 1000,
"vehicleLicense": ""
}
]
}
http PUT请求
url: http://host:port/car_wash/v1/user
{
"phone":1375108989,
"user": {
"name":"zyx",
"phone":13788888888,
"type":2,
"restMoney":3000
}
}
{"success":true,"msg":"","obj":null}
http DELETE请求
url: http://host:port/car_wash/v1/user/{id}
{"success":true,"msg":"","obj":null}
http POST请求
url: http://host:port/car_wash/v1/user/money
{
"phone":13788889898,
"money":1000
}
{"success":true,"msg":"","obj":null}
http GET请求
url: http://host:port/car_wash/v1/transaction
{
"success": true,
"msg": "",
"obj": [
{
"id": 1, //主键
"type": "精洗", //交易类型
"cost": 150, //交易金额
"date": "2018-08-06 15:00:00", //交易时间
"license": "苏J12345", //车牌
"phone": 13888888888, //会员手机
"payMethod": 2 //支付方式
}
]
}
http POST请求
url: http://host:port/car_wash/v1/transaction
{
"transaction":{
"type": "精洗",
"cost": 150,
"date": "2018-08-06 15:00:00",
"license": "苏J88099",
"phone": 13751089898,
"payMethod": 2
}
}
{"success":true,"msg":"","obj":null}
http PUT请求
url: http://host:port/car_wash/v1/transaction
{
"id":1,
"transaction":{
"type": "精洗",
"cost": 200,
"date": "2018-08-06 15:00:00",
"license": "苏J88099",
"phone": 13788888888,
"payMethod": 2
}
}
{"success":true,"msg":"","obj":null}
http DELETE请求
url: http://host:port/car_wash/v1/transaction/1
{"success":true,"msg":"","obj":null}