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

[BE] 체크리스트 방 정보 작성 API에 기능을 추가 구현한다 #189

Merged
merged 19 commits into from
Aug 1, 2024

Conversation

shin-jisong
Copy link
Contributor

@shin-jisong shin-jisong commented Jul 31, 2024

❗ Issue

✨ 구현한 기능

  • Checklist 도메인에 필드 추가
  • Room 도메인에 필드 추가
  • 체크리스트 방 정보 작성 로직 수정
  • 각종 예외 사항 처리

📢 논의하고 싶은 내용

Service랑 Controller, 추가된 도메인 위주로 봐 주세요~

🎸 기타

@shin-jisong shin-jisong added this to the 마일스톤 5주차 milestone Jul 31, 2024
@shin-jisong shin-jisong self-assigned this Jul 31, 2024
@shin-jisong shin-jisong changed the title 체크리스트 방 정보 작성 API에 기능을 추가 구현한다 [BE] 체크리스트 방 정보 작성 API에 기능을 추가 구현한다 Jul 31, 2024
Comment on lines 3 to 4
import static com.bang_ggood.category.domain.Badge.NONE;
import static com.bang_ggood.checklist.domain.ChecklistScore.calculateCategoryScore;
Copy link
Contributor

Choose a reason for hiding this comment

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

import 순서가 기존에 정한 순서랑 다른 것 같아요!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

현재 BE 코드 컨벤션에 작성되어 있는 것들은 다 적용하였는데 어떤 부분일까요?

Copy link
Contributor Author

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 {
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.

👍👍👍

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

Choose a reason for hiding this comment

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

도메인 Room이 검증하게 해보는건 어떨까요??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Service의 영역이라 생각했는데 충분히 room에서 할 수 있는 로직이네요! 반영하였습니다 👍

Comment on lines 122 to 127
List<ChecklistQuestion> checklistQuestions = checklistCreateRequest.questions().stream()
.map(question -> new ChecklistQuestion(
checklist,
Question.findById(question.questionId()),
Grade.from(question.grade()),
question.memo()))
Copy link
Contributor

Choose a reason for hiding this comment

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

Grade처럼 findById대신 from를 사용해보는건 어떨까요??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

기존에 구현되어 있는 함수를 사용하였는데 fromId라는 명명이 더 적절하겠네요! 변경해 주었습니다

Copy link
Contributor

@tkdgur0906 tkdgur0906 left a 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) {
Copy link
Contributor

Choose a reason for hiding this comment

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

함수 네이밍을 from, fromName중 어떤게 낫다고 생각하시나요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

내부 필드가 하나일 경우 from을 사용하고 여러 개일 경우 세부 필드를 명명으로 표시하는 게 좋다 생각했습니다! 카피는 어떻게 생각하시나요??

Copy link
Contributor

Choose a reason for hiding this comment

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

저도 동의합니다! 하나 있을떄는 From으로 가시죠

@tsulocalize tsulocalize merged commit 2469242 into dev-be Aug 1, 2024
1 check passed
@shin-jisong shin-jisong deleted the feat/182-post-checklist branch August 1, 2024 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants