-
Notifications
You must be signed in to change notification settings - Fork 6
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
[BE] 체크리스트 방 정보 작성 API에 기능을 추가 구현한다 #189
Conversation
import static com.bang_ggood.category.domain.Badge.NONE; | ||
import static com.bang_ggood.checklist.domain.ChecklistScore.calculateCategoryScore; |
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.
import 순서가 기존에 정한 순서랑 다른 것 같아요!
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.
현재 BE 코드 컨벤션에 작성되어 있는 것들은 다 적용하였는데 어떤 부분일까요?
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.
수정하였습니다~
@@ -4,23 +4,44 @@ | |||
|
|||
public enum ExceptionCode { |
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.
👍👍👍
@@ -85,6 +89,12 @@ private void createChecklistOptions(ChecklistCreateRequest checklistCreateReques | |||
checklistOptionRepository.saveAll(checklistOptions); | |||
} | |||
|
|||
private void validateRoom(Room room) { | |||
if (room.getFloorLevel() != FloorLevel.GROUND && room.getFloor() != null) { |
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.
도메인 Room이 검증하게 해보는건 어떨까요??
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.
Service의 영역이라 생각했는데 충분히 room에서 할 수 있는 로직이네요! 반영하였습니다 👍
List<ChecklistQuestion> checklistQuestions = checklistCreateRequest.questions().stream() | ||
.map(question -> new ChecklistQuestion( | ||
checklist, | ||
Question.findById(question.questionId()), | ||
Grade.from(question.grade()), | ||
question.memo())) |
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.
Grade처럼 findById대신 from를 사용해보는건 어떨까요??
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.
기존에 구현되어 있는 함수를 사용하였는데 fromId라는 명명이 더 적절하겠네요! 변경해 주었습니다
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.
간단히 의견만 여쭤봅니다!
고생하셨습니다!
this.name = name; | ||
} | ||
|
||
public static FloorLevel from(String name) { |
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.
함수 네이밍을 from, fromName중 어떤게 낫다고 생각하시나요?
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.
내부 필드가 하나일 경우 from을 사용하고 여러 개일 경우 세부 필드를 명명으로 표시하는 게 좋다 생각했습니다! 카피는 어떻게 생각하시나요??
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.
저도 동의합니다! 하나 있을떄는 From으로 가시죠
❗ Issue
✨ 구현한 기능
📢 논의하고 싶은 내용
Service랑 Controller, 추가된 도메인 위주로 봐 주세요~
🎸 기타