| Method | Endpoint | 설명 |
|---|---|---|
| GET | /api/feeds | 피드 목록 조회 |
| POST | /api/feeds | 피드 등록 |
| POST | /api/feeds/{feedId}/like | 피드 좋아요 |
| DELETE | /api/feeds/{feedId}/like | 피드 좋아요 취소 |
| GET | /api/feeds/{feedId}/comments | 피드 댓글 조회 |
| POST | /api/feeds/{feedId}/comments | 피드 댓글 등록 |
| DELETE | /api/feeds/{feedId} | 피드 삭제 |
| PATCH | /api/feeds/{feedId} | 피드 수정 |
FeedCreateRequest DTO
content: @NotBlankclothesIds: List<UUID> (연관된 의상)weatherId: UUID (날씨 정보)FeedDto (id, author, content, createdAt, clothes, weather)FeedCreatedEvent 발행 → 비동기 리스너에서 Elasticsearch 인덱싱 처리400 Bad Request: 입력값 오류404 Not Found: 잘못된 사용자/날씨/옷 ID 참조500 Internal Server Error: 서버 내부 오류작업 요약
API: GET /api/feeds
최신순(createdAt DESC/ASC), 인기순(likeCount DESC/ASC) 조회 지원
Pagination: Cursor 기반 페이징 (createdAt + id)
응답 DTO: FeedSummaryDto (id, author, previewContent, likeCount, commentCount, createdAt)
Elasticsearch 활용
{
"feedId": "7c8a9f12-34de-5678-9012-abcd3456ef78",
"createdAt": "2025-09-01T09:00:00Z",
"updatedAt": "2025-09-01T10:00:00Z",
"author": {
"userId": "1111-2222-3333-4444",
"name": "woody",
"profileImageUrl": "<https://cdn.monew.com/profile/woody.png>"
},
"likeCount": 15,
"weather": {
"weatherId": "wx-20250901",
"skyStatus": "CLOUDY",
"precipitation": {
"type": "RAIN",
"amount": 3.5,
"probability": 70.0
},
"temperature": {
"current": 24.5,
"comparedToDayBefore": -1.2,
"min": 20.0,
"max": 27.0
}
},
"ootds": [
{
"clothesId": "c-1001",
"name": "청자켓",
"imageKey": "ootd/2025/09/01/jacket.png",
"contentType": "image/png",
"type": "OUTER",
"attributes": {
"definitionId": "def-11",
"definitionName": "계절",
"selectableValues": ["봄", "가을"],
"value": "가을"
}
},
{
"clothesId": "c-1002",
"name": "흰색 티셔츠",
"imageKey": "ootd/2025/09/01/tshirt.png",
"contentType": "image/png",
"type": "TOP",
"attributes": {
"definitionId": "def-12",
"definitionName": "스타일",
"selectableValues": ["캐주얼", "포멀"],
"value": "캐주얼"
}
}
],
"content": "오늘은 청자켓과 흰색 티셔츠로 캐주얼한 스타일을 입었어요."
}
예외 처리
404 Not Found: 잘못된 feed ID 참조500 Internal Server Error: 조회 실패POST /api/feeds/{feedId}/like → 좋아요 등록DELETE /api/feeds/{feedId}/like → 좋아요 취소FeedLikeService.addLike(), FeedLikeService.removeLike()403 Forbidden: 본인이 아닌 경우404 Not Found: 없는 피드409 Conflict: 이미 좋아요 상태