-
描述:获取某用户信息
-
响应成功
- 状态码
- 200 OK
- 响应体样例
- 状态码
{
"name": "manley",
"password":"123456",
"id": 1,
"url": "/api/users/1",
"posts_url": "/api/users/1/posts"
}
- 响应失败
- 状态码
- 404 NOT FOUND
- 503 SERVICE UNAVAILABLE
- 响应体
- 状态码
{
"message": "Not found",
"api_url": "/api"
},
{
"message": "Server is busy",
"api_url": "/api"
}
-
描述:获取用户提过的问题列表
-
响应成功
- 状态码
- 200 OK
- 响应体样例
- 状态码
[
{
"id": 1911028,
"url": "/api/posts/1911028",
},
{
"id": 120765,
"url": "/api/posts/120765",
},
...
]
- 响应失败
- 状态码
- 404 NOT FOUND
- 503 SERVICE UNAVAILABLE
- 响应体
- 状态码
{
"message": "Not found",
"api_url": "/api"
},
{
"message": "Server is busy",
"api_url": "/api"
}
-
描述:获取用户提过的某个问题
-
响应成功
- 状态码
- 200 OK
- 响应体样例
- 状态码
[
{
"id": 1911028,
"url": "/api/posts/1911028",
}
]
- 响应失败
- 状态码
- 404 NOT FOUND
- 503 SERVICE UNAVAILABLE
- 响应体
- 状态码
{
"message": "Not found",
"api_url": "/api"
},
{
"message": "Server is busy",
"api_url": "/api"
}
-
描述:获取用户提过的问题列表
-
响应成功
- 状态码
- 200 OK
- 响应体样例
- 状态码
[
{
"id": 1911028,
"content": "如何评价图灵?",
"label": "早餐",
"url": "/api/posts/1911028",
},
{
"id": 120765,
"content": "如何评价唐纳德?",
"label": "午餐",
"url": "/api/posts/120765",
},
...
]
- 响应失败
- 状态码
- 404 NOT FOUND
- 503 SERVICE UNAVAILABLE
- 响应体
- 状态码
{
"message": "Not found",
"api_url": "/api"
},
{
"message": "Server is busy",
"api_url": "/api"
}
-
描述:获取用户提过的问题列表
-
响应成功
- 状态码
- 200 OK
- 响应体样例
- 状态码
[
{
"id": 1911028,
"content": "如何评价图灵?",
"label": "早餐",
"url": "/api/posts/1911028",
}
]
- 响应失败
- 状态码
- 404 NOT FOUND
- 503 SERVICE UNAVAILABLE
- 响应体
- 状态码
{
"message": "Not found",
"api_url": "/api"
},
{
"message": "Server is busy",
"api_url": "/api"
}
-
描述:用户注册时创建一个用户
-
请求
- 请求体样例
{
"name": "manley",
"password": "qewrtyuasdf",
}
- 响应成功
- 状态码
- 201 CREATED
- 响应体样例
- 状态码
{
"url": "/api/users/12432"
}
- 响应失败
- 状态码
- 409 CONFLICT
- 503 SERVICE UNAVAILABLE
- 响应体
- 状态码
{
"message": "User already exists",
"api_url": "/api"
},
{
"message": "Server is busy",
"api_url": "/api"
}
-
描述:用户发帖
-
请求
-
请求体参数
-
请求体样例
-
{
"name": "manley",
"password": "jfljsdfkljdfs"
"postId":"123456"
}
- 响应成功
- 状态码 + 201 CREATED
{
"url": "/api/users/1/posts/12432"
}
- 响应失败
- 状态码
- 401 UNAUTHORIZED
- 404 NOT FOUND
- 503 SERVICE UNAVAILABLE
- 响应体
- 状态码
{
"message": "Invalid email/phone or password",
"api_url": "/api"
},
{
"message": "Not found",
"api_url": "/api"
},
{
"message": "Server is busy",
"api_url": "/api"
}
-
描述:增加一个帖子
-
请求
- 请求体样例
{
"name": "manley",
"password": "123456",
"content": "要认真学习,不然后果很惨",
"label":"学习"
}
- 响应成功
- 状态码 + 201 CREATED
- 响应体样例
{
"url": "/api/posts/96612621"
}
- 响应失败
- 状态码
- 401 UNAUTHORIZED
- 404 NOT FOUND
- 503 SERVICE UNAVAILABLE
- 响应体
- 状态码
{
"message": "Invalid email/phone or password",
"api_url": "/api"
},
{
"message": "Not found",
"api_url": "/api"
},
{
"message": "Server is busy",
"api_url": "/api"
}
-
描述:删除某个用户
-
请求
- 请求体参数 用户名,密码
- 请求体样例
{
"name":"manley",
"password": "1123443sdf"
}
-
响应成功
- 状态码
- 204 NO CONTENT
- 无响应体
- 状态码
-
响应失败
- 状态码
- 401 UNAUTHORIZED
- 503 SERVICE UNAVAILABLE
- 响应体
- 状态码
{
"message": "Invalid email/phone or password",
"api_url": "/api"
},
{
"message": "Server is busy",
"api_url": "/api"
}
-
描述:删除某个用户的某个帖子
-
请求
- 请求体参数 用户名,密码
- 请求体样例
{
"name":"manley",
"password": "1123443sdf"
}
-
响应成功
- 状态码
- 204 NO CONTENT
- 无响应体
- 状态码
-
响应失败
- 状态码
- 401 UNAUTHORIZED
- 503 SERVICE UNAVAILABLE
- 响应体
- 状态码
{
"message": "Invalid email/phone or password",
"api_url": "/api"
},
{
"message": "Server is busy",
"api_url": "/api"
}
-
描述:删除某个帖子
-
请求
- 请求体参数 用户名,密码
- 请求体样例
{
"name":"manley",
"password": "1123443sdf"
}
-
响应成功
- 状态码
- 204 NO CONTENT
- 无响应体
- 状态码
-
响应失败
- 状态码
- 401 UNAUTHORIZED
- 503 SERVICE UNAVAILABLE
- 响应体
- 状态码
{
"message": "Invalid email/phone or password",
"api_url": "/api"
},
{
"message": "Server is busy",
"api_url": "/api"
}