Skip to content

Commit

Permalink
refactor: 질문 응답 시 질문 유형 필드 응답 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
nahyeon99 committed Aug 6, 2024
1 parent 012ce34 commit d53e5c2
Show file tree
Hide file tree
Showing 3 changed files with 475 additions and 466 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ public record MeetingQuestionAndAnswerListResponse(
@Schema(description = "모임의 질문 ID", example = "!", requiredMode = REQUIRED)
Long meetingQuestionId,

@Schema(description = "질문 유형", examples = {"SINGLE_CHOICE", "MULTIPLE_CHOICE"}, requiredMode = REQUIRED)
@Schema(description = "질문 유형",
examples = {"SINGLE_CHOICE", "MULTIPLE_SHORT_CHOICE", "MULTIPLE_DESCRIPTIVE_CHOICE"},
requiredMode = REQUIRED)
QuestionType questionType,

@Schema(description = "질문과 답 관련 응답", requiredMode = REQUIRED)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
package org.depromeet.sambad.moring.question.presentation.response;

import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.*;

import java.util.List;

import org.depromeet.sambad.moring.file.presentation.annotation.FullFileUrl;
import org.depromeet.sambad.moring.meeting.answer.presentation.response.AnswerResponse;
import org.depromeet.sambad.moring.question.domain.Question;
import org.depromeet.sambad.moring.question.domain.QuestionType;

import io.swagger.v3.oas.annotations.media.Schema;

public record QuestionResponse(
@Schema(description = "질문 ID", example = "1", requiredMode = REQUIRED)
Long questionId,

@FullFileUrl
@Schema(description = "질문 유형",
examples = {"SINGLE_CHOICE", "MULTIPLE_SHORT_CHOICE", "MULTIPLE_DESCRIPTIVE_CHOICE"},
requiredMode = REQUIRED)
QuestionType questionType,

@FullFileUrl
@Schema(description = "질문 이미지 URL", example = "https://example.com", requiredMode = REQUIRED)
String questionImageFileUrl,

Expand All @@ -28,6 +34,7 @@ public record QuestionResponse(
public static QuestionResponse from(final Question question) {
return new QuestionResponse(
question.getId(),
question.getQuestionType(),
question.getQuestionImageUrl(),
question.getTitle(),
AnswerResponse.from(question.getAnswers())
Expand Down
Loading

0 comments on commit d53e5c2

Please sign in to comment.