Node.js实战开发(此项目附有前端taro.js项目:taro-dva-lazyNotebook)
-
接口说明:创建一个新user
-
接口地址:/user/create (POST)
-
请求示例
// request body
{"userName":"测试一下","userPassword":"123123","email":"[email protected]","phone":"13333333333"}
// response
{
"code": "000000",
"msg": "创建成功",
"data": {
"createTime": "2019-12-23 16:26:45",
"updateTime": "2019-12-23 16:26:45",
"userId": 6,
"userName": "测试一下",
"userPassword": "123123",
"phone": "13333333333",
"email": "[email protected]"
}
}
-
接口说明:用户登录
-
接口地址:/user/login (POST)
-
请求示例
// request body
{"userName":"测试一下","userPassword":"123123"}
// response
{
"code": "000000",
"data": {
"userId": 6,
"userName": "测试一下",
"userPassword": "123123",
"phone": "13333333333",
"email": "[email protected]",
"createTime": "2019-12-23 16:45:00",
"updateTime": "2019-12-23 16:45:00"
},
"msg": "登录成功"
}
-
接口说明:用户详情的查询
-
接口地址:/user/queryDetail (GET)
-
请求示例
// request query string params
userId=6
// response
{
"code": "000000",
"msg": "查询成功",
"data": {
"createTime": "2019-12-23 16:45:01",
"updateTime": "2019-12-23 16:45:01",
"userId": 6,
"userName": "测试一下",
"userPassword": "123123",
"phone": "13333333333",
"email": "[email protected]"
}
}
-
接口说明:用户详情的查询
-
接口地址:/user/queryDetail (GET)
-
请求示例
// request query string params
userId=6
// response
{
"code": "000000",
"msg": "查询成功",
"data": {
"createTime": "2019-12-23 16:45:01",
"updateTime": "2019-12-23 16:45:01",
"userId": 6,
"userName": "测试一下",
"userPassword": "123123",
"phone": "13333333333",
"email": "[email protected]"
}
}
-
接口说明:创建一个目标
-
接口地址:/objective/create (POST)
-
请求示例
// request body
{"startTime":"2019-12-23","endTime":"2019-12-24","weight":5,"content":"这是内容"}
// response
{
"code": "000000",
"msg": "创建成功",
"data": {
"startTime": "2019-12-23 16:52:12",
"endTime": "2019-12-23 16:52:12",
"createTime": "2019-12-23 16:52:12",
"updateTime": "2019-12-23 16:52:12",
"objectiveId": 9,
"weight": 5,
"content": "这是内容",
"userId": 6,
"status": 1
}
}
-
接口说明:创建一个目标
-
接口地址:/objective/queryForPage (GET)
-
请求示例
// request query string params
page=1&size=10
// response
{
"code": "000000",
"msg": "创建成功",
"data": {
"count": 3,
"rows": [
{
"startTime": "2019-12-23 16:52:12",
"endTime": "2019-12-23 16:52:12",
"createTime": "2019-12-23 16:52:12",
"updateTime": "2019-12-23 16:52:12",
"objectiveId": 7,
"weight": "5",
"content": "先赚他一个亿,然后花很多钱哈哈哈哈哈哈哈哈哈哈",
"status": 1,
"userId": 1,
"isTop": true,
"destroyTime": null
},
{
"startTime": "2019-12-23 16:52:12",
"endTime": "2019-12-23 16:52:12",
"createTime": "2019-12-23 16:52:12",
"updateTime": "2019-12-23 16:52:12",
"objectiveId": 8,
"weight": "4",
"content": "先挣一个亿没毛病啊老铁",
"status": 1,
"userId": 1,
"isTop": false,
"destroyTime": null
},
{
"startTime": "2019-12-23 16:52:12",
"endTime": "2019-12-23 16:52:12",
"createTime": "2019-12-23 16:52:12",
"updateTime": "2019-12-23 16:52:12",
"objectiveId": 9,
"weight": "5",
"content": "这是内容",
"status": 1,
"userId": 6,
"isTop": null,
"destroyTime": null
}
]
}
}
-
接口说明:创建一个目标
-
接口地址:/objective/setTop (POST)
-
请求示例
// request body
{"objectiveId":8}
// response
{
"code": "000000",
"msg": "置顶成功",
"data": null
}
-
接口说明: 删除一个目标
-
接口地址:/objective/delete (DELETE)
-
请求示例
// request body
{"objectiveId":9}
// response
{
"code": "000000",
"msg": "删除成功",
"data": null
}
-
接口说明: 用户退出登录
-
接口地址:/user/logout (DELETE)
-
请求示例
// request body
{}
// response
{
"code": "000000",
"msg": "退出成功",
"data": null
}