-
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
fix: 카페 이미지 3개 초과하여 저장 시 예외 반환하는 로직 버그 수정 #140
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -350,7 +350,7 @@ public CafeImagesSaveResponse saveCafeImage(Long memberId, String mapId, List<Mu | |
private void validateOwnedCafeImagesCounts(Cafe cafe, Member member, List<MultipartFile> requestCafeImages) { | ||
List<CafeImage> currentOwnedCafeImages = cafe.getCafeImages() | ||
.stream() | ||
.filter(cafeImage -> cafeImage.isOwned(member)) | ||
.filter(cafeImage -> cafeImage.isOwned(member) && cafeImage.getIsUsed()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
따로 이 부분을 private method로 뺀 후, 적절한 네이밍을 짓는 것도 괜찮겠네요. (근데 기가막힌 네이밍 짓기가 좀 어려울 거 같긴 해요) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 케이님 리뷰 좋은데, 저는 여기서는 너무 많은 private 메서드는 지양하는게 좋기도 한 것 같아요. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 아 그리고 filter를 두개 쓰는 방안도 있을 것 같은데, 크리티컬 하고 크진 않지만 성능 상 테스트 해보면 지금이 더 좋다고 합니다~ |
||
.collect(Collectors.toList()); | ||
if (currentOwnedCafeImages.size() + requestCafeImages.size() > CAFE_IMAGES_PER_MEMBER_LIMIT_COUNTS) { | ||
throw new ExceedCageImagesTotalCountsException(); | ||
|
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.
그동안 이런 오타가 있었다니 새삼 놀랍네요ㅋㅋㅋ