[3주차] 시재욱/[feat] 게시글 도메인 API 구현#90
Open
seejaewook456-maker wants to merge 4 commits intoLeets-Official:시재욱/mainfrom
Hidden character warning
The head ref may contain hidden characters: "\uc2dc\uc7ac\uc6b1/3\uc8fc\ucc28"
Open
[3주차] 시재욱/[feat] 게시글 도메인 API 구현#90seejaewook456-maker wants to merge 4 commits intoLeets-Official:시재욱/mainfrom
seejaewook456-maker wants to merge 4 commits intoLeets-Official:시재욱/mainfrom
Conversation
yeonjuncho
approved these changes
Apr 8, 2026
yeonjuncho
left a comment
There was a problem hiding this comment.
👍 필요한 부분 깔끔하게 코드 작성해주신 것 같습니다. 고생하셨습니다!
LGH0507
approved these changes
Apr 8, 2026
LGH0507
left a comment
There was a problem hiding this comment.
코드 작성하시느라 수고 많으셨습니다! 전체적으로 공통 응답 구조 (ApiResponse, BaseCode) 및 유효성 검증 어노테이션 등을 적절히 활용하셔서 잘 작성하신 것 같습니다 👍
|
|
||
| @Getter | ||
| @RequiredArgsConstructor | ||
| public enum BaseCode { |
There was a problem hiding this comment.
모든 API 응답을 ApiResponse로 통일하고 BaseCode를 enum으로 코드와 메시지를 관리한 부분 잘 설계하신 것 같습니다!👍
| import java.util.Map; | ||
|
|
||
| @RestControllerAdvice | ||
| public class GlobalExceptionHandler { |
| public PostResponse createPost(PostCreateRequest request) { | ||
|
|
||
| User user = userRepository.findById(request.getUserId()) | ||
| .orElseThrow(() -> new IllegalArgumentException("유저 없음")); |
There was a problem hiding this comment.
현재는 메시지를 에러코드가 아닌 문자열로 반환하고 있는데 USER_NOT_FOUND 와 같이 전역 예외처리를 한다면 더욱 통일성 있는 응답 구조가 될 것 같습니다. 💊
ruchan04
approved these changes
Apr 9, 2026
| .orElseThrow(() -> new IllegalArgumentException("게시글 없음")); | ||
|
|
||
| List<PostBlockResponse> blocks = post.getBlocks().stream() | ||
| .sorted((a, b) -> a.getSortOrder() - b.getSortOrder()) |
There was a problem hiding this comment.
💬 스트림에서 정렬하는 것도 좋지만, DB 쿼리 단계에서 ORDER BY를 사용하거나 엔티티의 @orderby 어노테이션을 활용하면 애플리케이션의 메모리 부담을 줄일 수 있습니다. ✅
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1. 과제 요구사항 중 구현한 내용
2. 핵심 변경 사항
3. 실행 및 검증 결과
게시글 등록 성공한 경우
게시글 등록 과정에서 제목을 입력하지 않은 경우
게시글 조회
4. 완료 사항
5. 추가 사항
#89
제출 체크리스트
{이름}/main브랜치다{이름}/{숫자}주차브랜치다Reviewer 참고