Skip to content

Commit

Permalink
Fix: questionOptionId 식별값 응답 DTO 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
yxhwxn committed Aug 18, 2024
1 parent 0420ae8 commit 07d2ec6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,16 @@ public static class QuestionDTO {
private Long questionId;
private QuestionType questionType;
private String questionText;
private List<String> options;
private List<OptionDTO> options;

@Getter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public static class OptionDTO {
private Long questionOptionId;
private String optionText;
}
}

@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ public static SurveyResponseDTO.SurveyViewDTO toSurveyViewResultDTO(Survey surve
.questionType(question.getQuestionType())
.questionText(question.getQuestionText())
.options(question.getQuestionOptionList().stream()
.map(QuestionOption::getOptionText)
.map(option -> SurveyResponseDTO.SurveyViewDTO.QuestionDTO.OptionDTO.builder()
.questionOptionId(option.getId())
.optionText(option.getOptionText())
.build())
.collect(Collectors.toList()))
.build())
.collect(Collectors.toList());
Expand Down

0 comments on commit 07d2ec6

Please sign in to comment.