Post
动态列表
- 地址: GET /posts
- Demo:http://fakerapi.qiji.tech/posts
参数:
- lng:经度
- lat:纬度
- max-id:loadmore使用
- since-id:refresh使用
- page_size:每页显示条数,默认20条「optional」
max-id和since-id不同时使用
Response
[ { "id": 110, "content": "qqsss", "created_at": 1468774879, "count_images": 2, "lng": 30, "lat": 30, "images": [ { "id": 213, "url": "sss" }, { "id": 214, "url": "1111" } ], "userInfo": { "user_id": 22, "nickname": "MMfdsakf", "avatar": "", "gender": 0 }, "category": { "id": 1, "name": "心情状态" } }, { "id": 109, "content": "qqsss", "created_at": 1468570355, "count_images": 2, "lng": 30, "lat": 30, "images": [ { "id": 211, "url": "sss" }, { "id": 212, "url": "1111" } ], "userInfo": { "user_id": 22, "nickname": "MMfdsakf", "avatar": "", "gender": 0 }, "category": { "id": 1, "name": "心情状态" } } ]
Error
{
"message": "422 Unprocessable Entity",
"errors": {
"lng": [
"The lng field is required."
],
"lat": [
"The lat field is required."
]
},
"status_code": 422
}
发布帖子
- 地址: POST /posts
- Demo:http://fakerapi.qiji.tech/posts
参数:
- post_category_id:类别id
- lng:经度
- lat:纬度
- content:内容(optional)
- images:图片路径(optional、数组)
images和content不能同时为空
Response
{ "id": 111, "content": "fffff", "created_at": 1468818893, "count_images": 1, "lng": 10, "lat": 30, "images": [ { "id": 215, "url": "1111" } ], "userInfo": { "user_id": 22, "nickname": "MMfdsakf", "avatar": "", "gender": 0 }, "category": { "id": 1, "name": "心情状态" } }
Error
{
"message": "422 Unprocessable Entity",
"errors": {
"post_category_id": [
"The post category id field is required."
],
"lng": [
"The lng field is required."
]
},
"status_code": 422
}