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

체크리스트 질문 조회 API를 구현한다. #83

Merged
merged 12 commits into from
Jul 25, 2024

Conversation

shin-jisong
Copy link
Contributor

❗ Issue

✨ 구현한 기능

  • 체크리스트 질문 조회 기능을 구현한다.

📢 논의하고 싶은 내용

  • category_priority 스키마에서 category_id를 TINYINT 대신 INTEGER를 적용해야 정상적으로 작동된다.
    기존 설계에서는 TINYINT를 적용하기로 하였으나 클래스 설정을 INTEGER로 하여 해당 문제가 발생함.
    논의 후 변경 예정이다.

🎸 기타

Comment on lines +82 to +88
public String getTitleByQuestionId(int questionId) {
return questions.get(questionId).getTitle();
}

public String getSubtitleByQuestionId(int questionId) {
return questions.get(questionId).getSubtitle();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

getQuestion으로 가져와서 q.getSubtitle() / q.getTitle()을 쓰는 건 어떻게 생각하시나요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

현재 구조에서는 이 방식이 더 합리적인 것 같아 채택하였는데 추후 재활용성이 떨어지면 리팩토링하는 방식으로 가 보겠습니다!

Comment on lines 141 to 147
private void readChecklistQuestion(Category category, List<QuestionResponse> questionResponses) {
category.getQuestionIds().stream()
.map(questionId -> new QuestionResponse(questionId,
questionList.getTitleByQuestionId(questionId),
questionList.getSubtitleByQuestionId(questionId)))
.forEach(questionResponses::add);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

return type을 List로 주는 건 어떨까요?

Copy link
Contributor

@JINU-CHANG JINU-CHANG left a comment

Choose a reason for hiding this comment

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

간단히 코멘트 남겼습니다!
readChecklistQuestion메서드는 시간남을 때 조금 더 리팩토링해보면 좋을 것 같아요 😃


private final int id;
private final String description;
private final List<Integer> questionIds;
Copy link
Contributor

Choose a reason for hiding this comment

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

중복제거할 수 있는 Set 자료구조가 더 적합해보여요

@shin-jisong
Copy link
Contributor Author

모두 반영 완료하였습니다~

@JINU-CHANG JINU-CHANG merged commit c93534a into dev-be Jul 25, 2024
1 check passed
@JINU-CHANG JINU-CHANG deleted the feat/76-read-checklist-questions branch July 25, 2024 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants