[3주차] 이예서/[feat] 게시글 API 구현#114
Open
HandoA01 wants to merge 15 commits intoLeets-Official:이예서/mainfrom
Hidden character warning
The head ref may contain hidden characters: "\uc774\uc608\uc11c/3\uc8fc\ucc28"
Open
Conversation
kdobi
reviewed
Apr 8, 2026
| import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException; | ||
|
|
||
| @RestControllerAdvice | ||
| public class GlobalExceptionHandler { |
There was a problem hiding this comment.
전반적으로 코드가 깔끔해서 읽기 되게 좋은 것 같습니다!
예외처리도 글로벌에서 세분화해서 처리한 것도 좋아보이네요.
kallin1
approved these changes
Apr 9, 2026
| public class PostCreateRequest { | ||
|
|
||
| @NotNull(message = "사용자 ID는 필수입니다.") | ||
| private Long userId; |
There was a problem hiding this comment.
현재는 Request DTO 안에 userId가 포함되어 있는데, 나중에 Spring Security 등을 도입하게 된다면 컨트롤러에서 인증된 유저 정보를 서비스에 인자로 넘겨주는 방식이 더 안전할 수 있어 이러한 방향도 고민해 보면 좋을 것 같습니다!
HyeonSeongIM
approved these changes
Apr 9, 2026
There was a problem hiding this comment.
Service를 Intetface로 구성하고 ServiceImpl로 구현 클래스를 따로 두는 방식도 좋은 유지보수 코드가 될 것 같아요!
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. 과제 요구사항 중 구현한 내용
GET /postsGET /posts/{postId}POST /postsPATCH /posts/{postId}DELETE /posts/{postId}2. 핵심 변경 사항
ApiResponse공통 응답 포맷 적용 (isSuccess, code, message, result)ErrorCodeenum으로 에러 코드 일원화 관리GlobalExceptionHandler에 게시글 관련 예외 처리 추가PostConverter를 통한 Entity ↔ DTO 변환 책임 분리BaseEntity의delete()메서드를 활용한 soft delete 구현@NotBlank,@NotNull,@Size등 Bean Validation 적용@Valid로 요청 데이터 검증 활성화3. 실행 및 검증 결과
4. 완료 사항
5. 추가 사항
제출 체크리스트
{이름}/main브랜치다{이름}/{숫자}주차브랜치다Reviewer 참고