-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
좋아요 컬럼 반정규화 #893
base: dev/be
Are you sure you want to change the base?
좋아요 컬럼 반정규화 #893
Conversation
if (FALSE.equals(isLiked(member, template))) { | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
기존에는 실제 있는지 확인하지 않고 바로 삭제를 했었는데요~
count--; 를 엔티티 내부에서 해주게 되면서, 확인하는 로직이 없으면 문제가 발생합니다. (내가 좋아요 하지 않은 것도 count-- 되버림)
따라서 검증 추가했어요~!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
�코테 끝나자마자 프로젝트를 하다니...
역시 대단하네요 몰리 👍
정말 간단한 코멘트만 2개 남겨놨습니다. 확인 부탁드려요!
@@ -25,11 +28,12 @@ public class LikesService { | |||
@Transactional | |||
public void like(Member member, long templateId) { | |||
Template template = templateRepository.fetchById(templateId); | |||
if (isLiked(member, template)) { | |||
if (TRUE.equals(isLiked(member, template))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이렇게 변경한 이유가 궁금해요!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
그런데 public Boolean isLiked(Member member, Template template) { //
이 메서드가 래퍼타입 반환하게 되어 있어서네요.
isLiked 메서드가 변경되어야 할 것 같네요
@DisplayName("성공: 여러번 좋아요를 취소해도 정상 동작으로 판단") | ||
void multipleLikes() { | ||
@DisplayName("성공: 본인의 좋아요만 취소 가능") | ||
void multipleCancelLikes() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
multiple
도 같이 바꿔줘야 할 것 같아요
⚡️ 관련 이슈
close #741
📍주요 변경 사항
🎸기타
🍗 PR 첫 리뷰 마감 기한
11/06 13:00