-
Notifications
You must be signed in to change notification settings - Fork 0
group
LeeSangHoon edited this page Apr 24, 2023
·
2 revisions
| API | Description |
|---|---|
| GET /api/group | 그룹 목록 조회 |
| POST /api/group | 그룹 등록 |
| GET /api/group/:groupId | 그룹 상세 조회 |
| PUT /api/group/:groupId | 그룹 수정 |
| DELETE /api/group/:groupId | 그룹 삭제 |
| POST /api/group/:groupId/member | 멤버 추가 |
GET /api/group
- 서비스에서 취급하는 아이돌 그룹 멤버 목록을 조회합니다.
{
"_status": 200
"message": "그룹 목록을 조회했습니다.",
"groups": [
{
"groupId": 1,
"name": "BTS",
"imageName": "1_1681736074708.png",
"memberCount": 7
},
{
"groupId": 2,
"name": "TWICE",
"imageName": "2_1681736193995.png",
"memberCount": 9
}
]
}POST /api/group
- 새로운 아이돌 그룹을 등록합니다.
| Parameter | Target | Type | Description |
|---|---|---|---|
| name | body | string | 그룹 이름 |
| image | body | file | 로고 이미지 파일 |
{
"_status": 200,
"message": "새로운 그룹을 등록했어요.'"
}GET /api/group/:groupId
- 특정 그룹의 상세 정보를 조회합니다.
| Parameter | Target | Type | Description |
|---|---|---|---|
| groupId | param | number | 그룹 ID |
{
"_status": 200,
"message": "1번 그룹의 상세 정보를 조회했습니다.",
"groupId": 1,
"name": "BTS",
"imageName": "1_1681736074708.png",
"members": [
{
"groupId": 1,
"memberId": 1,
"name": "진",
"photoCount": 29
},
{
"groupId": 1,
"memberId": 2,
"name": "슈가",
"photoCount": 29
},
{
"groupId": 1,
"memberId": 3,
"name": "제이홉",
"photoCount": 29
}
]
}
{
"_status": 404,
"message": "해당 그룹의 데이터가 서버에 존재하지 않아요."
}PUT /api/group/:groupId
- 그룹 정보를 수정합니다.
| Parameter | Target | Type | Description |
|---|---|---|---|
| groupId | param | number | 그룹 ID |
| name | body | string | 그룹 이름 |
| image | body | file | 로고 이미지 파일 |
{
"_status": 400,
"message": "그룹 정보를 수정했어요."
}
{
"_status": 404,
"message": "수정하려는 그룹을 찾지 못했어요."
}DELETE /api/group/:groupId
- 그룹을 삭제합니다.
| Parameter | Target | Type | Description |
|---|---|---|---|
| groupId | param | number | 그룹 ID |
{
"_status": 200,
"message": "그룹 BTS 을(를) 수정했어요."
}
{
"_status": 400,
"message": "해당 그룹의 멤버를 먼저 지워주세요."
}
{
"_status": 404,
"message": "해당 그룹의 데이터가 서버에 존재하지 않아요."
}