Skip to content

Commit

Permalink
refactor: of 메서드 대신 생성자를 사용하도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
amaran-th committed Sep 8, 2023
1 parent 699ecf2 commit 6a8c65f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public QuizzesResponse findQuizzesByKeywordId(Long keywordId, Long memberId) {
final List<QuizResponse> quizResponses = quizzes.stream()
.map(quiz -> QuizResponse.of(quiz, isLearning(memberId, quiz.getId())))
.collect(Collectors.toList());
return QuizzesResponse.of(keywordId, quizResponses);
return new QuizzesResponse(keywordId, quizResponses);
}

private boolean isLearning(Long memberId, Long quizId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,4 @@ public QuizzesResponse(Long keywordId,
this.keywordId = keywordId;
this.data = data;
}

public static QuizzesResponse of(Long keywordId, List<QuizResponse> quizzes) {
return new QuizzesResponse(keywordId, quizzes);
}
}

0 comments on commit 6a8c65f

Please sign in to comment.