Merged
Conversation
nayonsoso
approved these changes
Aug 17, 2024
Collaborator
nayonsoso
left a comment
There was a problem hiding this comment.
워낙 코드를 잘 짜주셔서 ㅎㅎ 이번엔 리뷰할게 별로 없었네요!
작업하시느라 수고 많으셨습니다🥳
[정말로 궁금해서 묻는 질문]
'게시글 좋아요 / 좋아요 취소를 하나의 API 에서 한다'는 선택지도 있었을텐데
왜 API 를 따로 만드셨나 궁금해요!
Comment on lines
+112
to
+115
| void 게시글_좋아요_동시성_문제를_해결한다() throws InterruptedException { | ||
|
|
||
| ExecutorService executorService = Executors.newFixedThreadPool(THREAD_POOL_SIZE); | ||
| CountDownLatch doneSignal = new CountDownLatch(THREAD_NUMS); |
Comment on lines
+5
to
+7
| public record PostLikeResponse( | ||
| Long likeCount, | ||
| Boolean isLiked |
Collaborator
There was a problem hiding this comment.
[반영 안 해도 되는 개인적 생각]
래퍼 클래스는 "null 이 올 가능성이 있을 때" 만 사용하는 것이 좋다 생각해요. 메모리상으로도 효율적이고, 다른 개발자들에게 null 의 가능성을 알려준다는 것도 중요하다 생각해서요!
Member
Author
There was a problem hiding this comment.
오,, 해당부분은 제가 크게 놓치고 있었던 내용이네요,,
래퍼클래스의 장점 때문에 무분별하게 사용하고 있었던 것 같은데 null이 올 가능성이 없을때 등 불필요한 상황에서의 래퍼클래스 사용은 지양하는게 좋다는 생각이 드네요. 감사합니다!
Member
Author
단순히 게시글의 좋아요 수를 +-1 하는것 뿐만아니라, 추후 '내가 좋아요한 게시글 조회' 등과 같은 기능확장을 위해서 |
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.
관련 이슈
작업 내용
게시글 좋아요 관련된 API 구현하였습니다.
테스트코드 작성하였습니다.
모든 테스트 정상동작 합니다.
특이 사항
게시글 좋아요 수 갱신 시점에 동시성 이슈 발생하여 내용 작성하였습니다.
게시글_좋아요_고찰.docx
특정 게시글 조회시 isLiked 값도 반환하도록 수정하였습니다.
리뷰 요구사항 (선택)