My Group's Post List (Newsfeed)
내가 속한 그룹의 Post object의 목록을 보여줍니다.
page로 Pagination 번호를 받을 수 있으며, 주어지지 않을 경우 1페이지로 취급됩니다.
URL
/post/my-group/
Method
GET
URL Params
Key | Description | Value | Type | Require |
---|---|---|---|---|
page | page 번호 | Page Number | Integer | False |
URL
/api/post/
Method
GET
URL Params
Key | Description | Value | Type | Require |
---|---|---|---|---|
page | page 번호 | Page Number | Integer | False |
search | 검색하려는 단어가 포함된 Post 리스트를 반환 | keyword | String | False |
author | 검색하려는 author의 pk (member 또는 user와 같은 개념) | author pk (member pk 또는 user pk와 같은 개념) | Integer | False |
group | 검색하려는 group의 pk | group pk | Integer | False |
Success Response
HTTP Status Code
200
content
{
"count": [전체 Post 개수],
"next" [다음 page API주소 링크, 존재하지 않으면 null],
"previous": [이전 page API주소 링크, 존재하지 않으면 null],
"results" [
//해당 page에 속하는 Post 목록
{
//각 Post object
},
{
...
}
]
}
{
"count": 4,
"next": null,
"previous": null,
"results": [
{
"pk": 4,
"author": {
"pk": 1,
"email": "[email protected]",
"nickname": "admin",
"username": "",
"profile_img": "http://localhost:8000/static/images/no_profile.png"
},
"group": {
"pk": 1,
"name": "Test Group",
"profile_img": "http://localhost:8000/media/images/no_group_img.png",
"owner": {
"pk": 1,
"email": "[email protected]",
"nickname": "admin",
"username": "",
"profile_img": "http://localhost:8000/static/images/no_profile.png"
},
"group_type": "PUBLIC",
"description": "description input test",
"num_of_members": 2,
"tags": [
{
"pk": 1,
"name": "test1"
},
{
"pk": 2,
"name": "test2"
},
{
"pk": 3,
"name": "test3"
}
],
"is_member": true
},
"content": "Test Post4",
"image": null,
"video": null,
"like_count": 0,
"comment_count": 0,
"is_like": false
},
{
"pk": 3,
"author": {
"pk": 1,
"email": "[email protected]",
"nickname": "admin",
"username": "",
"profile_img": "http://localhost:8000/static/images/no_profile.png"
},
"group": {
"pk": 1,
"name": "Test Group",
"profile_img": "http://localhost:8000/media/images/no_group_img.png",
"owner": {
"pk": 1,
"email": "[email protected]",
"nickname": "admin",
"username": "",
"profile_img": "http://localhost:8000/static/images/no_profile.png"
},
"group_type": "PUBLIC",
"description": "description input test",
"num_of_members": 2,
"tags": [
{
"pk": 1,
"name": "test1"
},
{
"pk": 2,
"name": "test2"
},
{
"pk": 3,
"name": "test3"
}
],
"is_member": true
},
"content": "Test Post3",
"image": null,
"video": null,
"like_count": 0,
"comment_count": 0,
"is_like": false
},
{
"pk": 2,
"author": {
"pk": 1,
"email": "[email protected]",
"nickname": "admin",
"username": "",
"profile_img": "http://localhost:8000/static/images/no_profile.png"
},
"group": {
"pk": 1,
"name": "Test Group",
"profile_img": "http://localhost:8000/media/images/no_group_img.png",
"owner": {
"pk": 1,
"email": "[email protected]",
"nickname": "admin",
"username": "",
"profile_img": "http://localhost:8000/static/images/no_profile.png"
},
"group_type": "PUBLIC",
"description": "description input test",
"num_of_members": 2,
"tags": [
{
"pk": 1,
"name": "test1"
},
{
"pk": 2,
"name": "test2"
},
{
"pk": 3,
"name": "test3"
}
],
"is_member": true
},
"content": "Test Post2",
"image": null,
"video": null,
"like_count": 0,
"comment_count": 0,
"is_like": false
},
{
"pk": 1,
"author": {
"pk": 1,
"email": "[email protected]",
"nickname": "admin",
"username": "",
"profile_img": "http://localhost:8000/static/images/no_profile.png"
},
"group": {
"pk": 1,
"name": "Test Group",
"profile_img": "http://localhost:8000/media/images/no_group_img.png",
"owner": {
"pk": 1,
"email": "[email protected]",
"nickname": "admin",
"username": "",
"profile_img": "http://localhost:8000/static/images/no_profile.png"
},
"group_type": "PUBLIC",
"description": "description input test",
"num_of_members": 2,
"tags": [
{
"pk": 1,
"name": "test1"
},
{
"pk": 2,
"name": "test2"
},
{
"pk": 3,
"name": "test3"
}
],
"is_member": true
},
"content": "Test Post",
"image": null,
"video": null,
"like_count": 1,
"comment_count": 8,
"is_like": true
}
]
}
Error response
Unauthorized error
HTTP Status code
401
Content
{
"detail": "자격 인증데이터(authentication credentials)가 제공되지 않았습니다."
}
Page does not exist error
HTTP Status code404
Content
{
"detail": "Invalid page."
}