[4주차] 김동빈/feat 게시물·댓글·신고 도메인 상태 전이 및 중복 방지 및 게시글 좋아요 API 구현#139
Open
kdobi wants to merge 5 commits intoLeets-Official:김동빈/mainfrom
Hidden character warning
The head ref may contain hidden characters: "\uae40\ub3d9\ube48/4\uc8fc\ucc28"
Open
[4주차] 김동빈/feat 게시물·댓글·신고 도메인 상태 전이 및 중복 방지 및 게시글 좋아요 API 구현#139kdobi wants to merge 5 commits intoLeets-Official:김동빈/mainfrom
kdobi wants to merge 5 commits intoLeets-Official:김동빈/mainfrom
Conversation
|
4주차 개발도 수고 많으셨습니다!! |
HandoA01
approved these changes
Apr 30, 2026
Comment on lines
+53
to
+59
| public static PostReport create(User user, Post post, String reason) { | ||
| return PostReport.builder() | ||
| .user(user) | ||
| .post(post) | ||
| .reason(reason) | ||
| .build(); | ||
| } |
There was a problem hiding this comment.
엔티티에 create() 정적 팩토리 메서드를 둬서 객체 생성을 캡슐화한 부분 좋네요. 저는 Converter 클래스로 빼서 처리했는데, 이렇게 엔티티 안에 두니까 서비스에서 PostReport.create(user, post, reason) 한 줄로 끝나서 더 깔끔한 것 같습니다!! 잘 배워갑니다! :)
HyeonSeongIM
approved these changes
Apr 30, 2026
| @Getter | ||
| @Builder | ||
| @AllArgsConstructor | ||
| public class PostLikeResponse { |
There was a problem hiding this comment.
DTO를 class 형태가 아닌 record 형태로 바꿔보시는 건 어떨까요?! record만의 장점이 따로 있는데 이 장점들이 DTO에 적합한거 같아요!
|
|
||
| @Service | ||
| @RequiredArgsConstructor | ||
| @Transactional(readOnly = true) |
There was a problem hiding this comment.
서비스 전체에 트랜잭션을 건다면 추후 코드가 확장될 때 무자비한 트랜잭션들이 걸릴 것 같습니다!
kallin1
approved these changes
Apr 30, 2026
| @@ -52,4 +72,8 @@ public void update(String title, String content) { | |||
| this.content = content; | |||
There was a problem hiding this comment.
update 메서드로직을 보니 title이 null이거나 blank일 경우 content가 같이 업데이트 되지 않을 수도 있을 거 같아요! 의도하신게 아니라면 두 개를 분리해서 체크하시는게 어떨까 합니당
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. 과제 요구사항 중 구현한 내용
구현 API(주요):
POST /api/posts/{postId}/reports게시물 신고POST /api/comments/{commentId}/reports댓글 신고PATCH /api/reports/{reportId}/resolve신고 처리 완료 (PENDING -> RESOLVED)POST /api/posts/{postId}/likes게시물 좋아요 생성 및 중복 좋아요 방지 처리2. 핵심 변경 사항
신고 ( report ) => 게시물/댓글 신고 API 및 신고 처리 완료 API 구현, 신고 상태 PENDING/
RESOLVED 관리
좋아요 ( like ) => 게시물 좋아요 생성 API 구현, 동일 유저의 동일 게시물 좋아요 중복
방지
3. 실행 및 검증 결과
GET /health응답:POST /string/repeat요청/응답:4. 완료 사항
5. 추가 사항
closed #134제출 체크리스트
{이름}/main브랜치다{이름}/{숫자}주차브랜치다Reviewer 참고