-
Notifications
You must be signed in to change notification settings - Fork 0
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
[Features/review] 리뷰 도메인 구현 #23
Conversation
@NotNull boolean kindness, | ||
@NotNull boolean cheapFee, | ||
@NotNull boolean goodFacility, | ||
@NotNull boolean goodManagement, | ||
@NotNull boolean lovelyTeaching |
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.
boolean이라 @NotNull 처리 안해주셔도 될 것 같습니다!
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.
아 그러네요
primitive 타입이니까 애초에 null 값이 들어가지 않겠네요!
private static void validateThreeReviewLimit(final Map<ReviewType, Boolean> map) { | ||
long count = map.values().stream() | ||
.filter(value -> value) | ||
.count(); | ||
|
||
if (count > 3) { | ||
throw new ReviewException("리뷰는 3개까지만 가능합니다."); | ||
} | ||
} |
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.
매직 넘버 3을 상수로 바꾸겠습니다!
@MemberId Long memberId, | ||
@RequestParam Long academyId | ||
) { | ||
ReviewableResult result = reviewService.isReviewableToAcademy(memberId, academyId); |
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.
is
라서 boolean
만을 return 할 것 같은데, result
를 리턴해서 조금 어색한 것 같습니다!
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.
getReviewableToAcademy 로 바꾸겠습니다!
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.
수고하셨습니다! 리뷰 로직이 생각보다 간단하진 않네요
API 괴물 박세영...👍
기능 구현
필요 사항