-
Notifications
You must be signed in to change notification settings - Fork 2
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
[Feat] #20 인플루언서 좋아요와 반영하여 반환하도록 했어요 #72
Conversation
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.
리뷰 작성했습니다.
List<FavoriteInfluencer> findByUserId(Long userId); | ||
|
||
Optional<FavoriteInfluencer> findByUserAndInfluencer(User user, Influencer influencer); |
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.
왜 객체로 호출하는지 여줘봐도 될까요?
Set<Long> likedInfluencerIds = favoriteRepository.findByUserId(userId).stream() | ||
.filter(FavoriteInfluencer::isLiked) | ||
.map(FavoriteInfluencer::getInfluencer) | ||
.map(Influencer::getId) | ||
.collect(Collectors.toSet()); |
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.
Set으로 하신 이유가 있을까요?
FavoriteInfluencer favorite = favoriteRepository.findByUserAndInfluencer(user, influencer) | ||
.orElseGet(() -> new FavoriteInfluencer(user, influencer)); // 존재하지 않으면 새로 생성 | ||
|
||
favorite.updateLike(param.likes()); | ||
favoriteRepository.save(favorite); |
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.
Transaction이 있는데 save가 필요할까요?
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.
.orElseGet(() -> new FavoriteInfluencer(user, influencer))
여기서 새 객체 생성되는 경우에는 save 필요하지 않나요?!?
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.
수고많으셨습니다! approve 하겠습니다.
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.
수정사항 반영해주셔서 감사합니다 고생하셧어요!
✨ 작업 내용
✨ 참고 사항
⏰ 현재 버그
✏ Git Close