Skip to content
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

Merged
merged 9 commits into from
Nov 6, 2023
Merged

Conversation

onetuks
Copy link
Contributor

@onetuks onetuks commented Nov 4, 2023

기능 구현

  • 리뷰 등록
    • 한 사람 당 10개의 리뷰만 등록 가능
    • 리뷰 항목 5개 중 3개 까지만 리뷰 가능
  • 리뷰 등록 가능 여부 조회

필요 사항

  • 존재하는 member 인지 확인하는 로직 필요
  • 존재하는 academy 인지 확인하는 로직 필요
  • 해당 사항을 AOP로 구현 ?

@onetuks onetuks added the enhancement New feature or request label Nov 4, 2023
@onetuks onetuks self-assigned this Nov 4, 2023
Comment on lines 9 to 13
@NotNull boolean kindness,
@NotNull boolean cheapFee,
@NotNull boolean goodFacility,
@NotNull boolean goodManagement,
@NotNull boolean lovelyTeaching
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

boolean이라 @NotNull 처리 안해주셔도 될 것 같습니다!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 그러네요
primitive 타입이니까 애초에 null 값이 들어가지 않겠네요!

Comment on lines 48 to 56
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개까지만 가능합니다.");
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

상수로 빼도 좋을 것 같습니다!

Copy link
Contributor Author

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);
Copy link
Contributor

@wonu606 wonu606 Nov 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is 라서 boolean만을 return 할 것 같은데, result를 리턴해서 조금 어색한 것 같습니다!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getReviewableToAcademy 로 바꾸겠습니다!

wonu606
wonu606 previously approved these changes Nov 4, 2023
Copy link
Contributor

@wonu606 wonu606 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다! 리뷰 로직이 생각보다 간단하진 않네요
API 괴물 박세영...👍

@onetuks onetuks merged commit e63f241 into develop Nov 6, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants