Skip to content

Commit

Permalink
♻️ 스테디 포지션 생성 방식 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
weonest committed Dec 27, 2023
1 parent 372456c commit 5b56705
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/main/java/dev/steady/steady/service/SteadyService.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,19 +237,16 @@ private Stack getStack(Long stackId) {

private List<SteadyPosition> createSteadyPositions(List<Long> positions, Steady steady) {
return IntStream.range(0, positions.size())
.mapToObj(index -> createSteadyPosition(positions, steady, index))
.mapToObj(index -> {
Position position = positionRepository.getById(positions.get(index));
return SteadyPosition.builder()
.position(position)
.steady(steady)
.build();
})
.toList();
}

private SteadyPosition createSteadyPosition(List<Long> positions, Steady steady, int index) {
Position position = positionRepository.getById(positions.get(index));

return SteadyPosition.builder()
.position(position)
.steady(steady)
.build();
}

private List<SteadyQuestion> createSteadyQuestions(List<String> questions, Steady steady) {
return IntStream.range(0, questions.size())
.mapToObj(index -> SteadyQuestion.builder()
Expand Down

0 comments on commit 5b56705

Please sign in to comment.