Skip to content

Commit

Permalink
�chore: enum 변경 및 스웨거 추가 (#123)
Browse files Browse the repository at this point in the history
* chore: Type CUSTOM으로 변경

* chore: 스웨거 추가
  • Loading branch information
mikekks authored Aug 4, 2024
1 parent 467c1b8 commit 19ce36f
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@

import java.util.List;

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

@Schema(name = "AnswerByPersonGetResponse", description = "개인별 답변 조회 응답 Dto")
public record AnswerByPersonGetResponse(
@Schema(description = "답변자", example = "홍길동")
String name,
@Schema(description = "질문-답변 객체", example = "")
List<QuestionAndAnswerGetResponse> answers
) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@

import java.util.List;

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

@Schema(name = "AnswerByQuestionGetResponse", description = "임시 회고 조회 응답 Dto")
public record AnswerByQuestionGetResponse(
@Schema(description = "질문 내용", example = "질문 내용입니당")
String questionContent,
@Schema(description = "질문 타입", example = "plain_text")
String questionType,
@Schema(description = "질문 객체", example = "")
List<PersonAndAnswerGetResponse> answers
) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@

import java.util.List;

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

@Schema(name = "AnswerListGetResponse", description = "회고 결과 조회 응답 Dto")
public record AnswerListGetResponse(
@Schema(description = "질문 기준 결과", example = "")
List<AnswerByQuestionGetResponse> questions,
@Schema(description = "개별 기준 결과", example = "")
List<AnswerByPersonGetResponse> individuals
) {
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
package org.layer.domain.answer.controller.dto.response;

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

@Schema(name = "PersonAndAnswerGetResponse", description = "개인-답변 응답 Dto")
public record PersonAndAnswerGetResponse(
@Schema(description = "답변자", example = "홍길동")
String name,
@Schema(description = "답변 내용", example = "답변 내용입니당")
String answerContent
) {
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
package org.layer.domain.answer.controller.dto.response;

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

@Schema(name = "QuestionAndAnswerGetResponse", description = "질문-답변 Dto")
public record QuestionAndAnswerGetResponse(
@Schema(description = "질문 내용", example = "질문 내용입니다.")
String questionContent,
@Schema(description = "질문 타입", example = "plain_text")
String questionType,
@Schema(description = "답변 내용", example = "답변 내용입니다.")
String answerContent
) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.layer.domain.common.time.Time;
import org.layer.domain.form.entity.Form;
import org.layer.domain.form.entity.FormType;
import org.layer.domain.form.enums.FormTag;
import org.layer.domain.form.repository.FormRepository;
import org.layer.domain.question.entity.Question;
import org.layer.domain.question.enums.QuestionOwner;
Expand Down Expand Up @@ -64,9 +65,8 @@ public Long createRetrospect(RetrospectCreateRequest request, Long spaceId, Long
// 새로운 폼 생성(수정)인지 확인
if (request.isNewForm()) {
// 내 회고 폼에 추가
Form baseForm = formRepository.findByIdOrThrow(request.curFormId());
Form form = new Form(memberId, spaceId, request.title(), request.introduction(), FormType.CUSTOM,
baseForm.getFormTag());
FormTag.CUSTOM);
Form savedForm = formRepository.save(form);

List<Question> myQuestions = getQuestions(request.questions(), null, savedForm.getId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ public enum FormTag {
MAD_SAD_GLAD("Mad Sad Glad"),
SSC("SSC"),
PMI("PMI"),
UNTITLED("무제");
UNTITLED("무제"),
CUSTOM("CUSTOM");

private final String tag;
}

0 comments on commit 19ce36f

Please sign in to comment.