Group List
MyGroup object의 목록을 돌려줍니다.
GET Parameter로 page, search, member를 받을 수 있습니다.
page로 Pagination 번호를 받을 수 있으며, 주어지지 않을 경우 1페이지로 취급됩니다.
search로 검색 키워드를 받을 수 있으며, 그룹의 이름이나 그룹의 설명, 그룹이 가진 태그의 이름에 해당 키워드가 포함된 그룹의 목록을 보여줍니다. 주어지지 않을 경우 전체 그룹 목록을 보여줍니다.
member로 사용자의 primary key를 받을 수 있으며, 해당 pk를 가진 멤버가 가입한 그룹의 목록을 보여줍니다. 주어지지 않을 경우 전체 그룹 목록을 보여줍니다.
로그인을 한 경우, 자신이 가입한 HIDDEN 그룹이 목록에 출력되며, 로그인을 하지 않은 경우에는 그룹타입이 HIDDEN인 그룹은 보여주지 않습니다.
URL/group/
MethodGET
URL Params
Key | Description | Value | Type | Require |
---|---|---|---|---|
page | 페이지 번호 | Page number | Integer | False |
search | 검색하려는 단어. 그룹의 이름, 설명, 태그에 해당 단어가 포함된 그룹 리스트를 반환 | search keyword | String | False |
member | 검색하려는 멤버의 pk | member's pk | Integer | False |
Success response
HTTP Status code200
Content
{
"count": [전체 MyGroup 개수],
"next" [다음 page API주소 링크, 존재하지 않으면 null],
"previous": [이전 page API주소 링크, 존재하지 않으면 null],
"results" [
//해당 page에 속하는 MyGroup 목록
{
//각 MyGroup object
},
{
...
}
]
}
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"pk": 1,
"name": "Test Group",
"profile_img": "http://localhost:8000/static/images/no_image.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"
}
]
},
{
"pk": 2,
"name": "Test Group2",
"profile_img": "http://localhost:8000/static/images/no_image.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": 1,
"tags": [
{
"pk": 9,
"name": "test4"
},
{
"pk": 10,
"name": "test5"
},
{
"pk": 11,
"name": "test6"
}
]
}
]
}
Error response
Page does not exist error
HTTP Status code404
Content
{
"detail": "Invalid page."
}