From 32cc184b2320563e2aa1a6b2a2ecf6e727e10e37 Mon Sep 17 00:00:00 2001 From: donghoony Date: Wed, 18 Dec 2024 23:28:39 +0900 Subject: [PATCH 1/3] =?UTF-8?q?style:=20=EA=B0=9C=ED=96=89=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/reviewme/template/domain/QuestionType.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/main/java/reviewme/template/domain/QuestionType.java b/backend/src/main/java/reviewme/template/domain/QuestionType.java index 78b84fb58..4213ce925 100644 --- a/backend/src/main/java/reviewme/template/domain/QuestionType.java +++ b/backend/src/main/java/reviewme/template/domain/QuestionType.java @@ -1,8 +1,8 @@ package reviewme.template.domain; public enum QuestionType { + CHECKBOX, TEXT, ; - } From 914a2d854e0fc67be2a57dc0a4bf1cc2bad650a7 Mon Sep 17 00:00:00 2001 From: donghoony Date: Wed, 18 Dec 2024 23:29:30 +0900 Subject: [PATCH 2/3] =?UTF-8?q?refactor:=20Dto=EC=97=90=20Enum=20=EC=A7=81?= =?UTF-8?q?=EC=A0=91=20=EC=82=AC=EC=9A=A9=ED=95=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/dto/response/QuestionResponse.java | 3 ++- .../template/service/dto/response/SectionResponse.java | 3 ++- .../template/service/mapper/TemplateMapper.java | 4 ++-- .../src/test/java/reviewme/api/TemplateFixture.java | 10 +++++----- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/backend/src/main/java/reviewme/template/service/dto/response/QuestionResponse.java b/backend/src/main/java/reviewme/template/service/dto/response/QuestionResponse.java index 90d1fb45e..d03da4d57 100644 --- a/backend/src/main/java/reviewme/template/service/dto/response/QuestionResponse.java +++ b/backend/src/main/java/reviewme/template/service/dto/response/QuestionResponse.java @@ -1,12 +1,13 @@ package reviewme.template.service.dto.response; import jakarta.annotation.Nullable; +import reviewme.template.domain.QuestionType; public record QuestionResponse( long questionId, boolean required, String content, - String questionType, + QuestionType questionType, @Nullable OptionGroupResponse optionGroup, boolean hasGuideline, @Nullable String guideline diff --git a/backend/src/main/java/reviewme/template/service/dto/response/SectionResponse.java b/backend/src/main/java/reviewme/template/service/dto/response/SectionResponse.java index 31ae9d849..bb59001fc 100644 --- a/backend/src/main/java/reviewme/template/service/dto/response/SectionResponse.java +++ b/backend/src/main/java/reviewme/template/service/dto/response/SectionResponse.java @@ -2,11 +2,12 @@ import jakarta.annotation.Nullable; import java.util.List; +import reviewme.template.domain.VisibleType; public record SectionResponse( long sectionId, String sectionName, - String visible, + VisibleType visible, @Nullable Long onSelectedOptionId, String header, List questions diff --git a/backend/src/main/java/reviewme/template/service/mapper/TemplateMapper.java b/backend/src/main/java/reviewme/template/service/mapper/TemplateMapper.java index 41f003e8c..b2dcc7afa 100644 --- a/backend/src/main/java/reviewme/template/service/mapper/TemplateMapper.java +++ b/backend/src/main/java/reviewme/template/service/mapper/TemplateMapper.java @@ -70,7 +70,7 @@ private SectionResponse mapToSectionResponse(TemplateSection templateSection) { return new SectionResponse( section.getId(), section.getSectionName(), - section.getVisibleType().name(), + section.getVisibleType(), section.getOnSelectedOptionId(), section.getHeader(), questionResponses @@ -90,7 +90,7 @@ private QuestionResponse mapToQuestionResponse(SectionQuestion sectionQuestion) question.getId(), question.isRequired(), question.getContent(), - question.getQuestionType().name(), + question.getQuestionType(), optionGroupResponse, question.hasGuideline(), question.getGuideline() diff --git a/backend/src/test/java/reviewme/api/TemplateFixture.java b/backend/src/test/java/reviewme/api/TemplateFixture.java index 7a8f3c194..a1a05349c 100644 --- a/backend/src/test/java/reviewme/api/TemplateFixture.java +++ b/backend/src/test/java/reviewme/api/TemplateFixture.java @@ -29,14 +29,14 @@ public static TemplateResponse templateResponse() { 1, true, "프로젝트 기간 동안, 아루의 강점이 드러났던 순간을 선택해주세요.", - QuestionType.CHECKBOX.name(), + QuestionType.CHECKBOX, new OptionGroupResponse(1, 1, 2, firstSectionOptions), false, null ) ); SectionResponse firstSection = new SectionResponse( - 1, "카테고리 선택", VisibleType.ALWAYS.name(), null, "아루와 함께 한 기억을 떠올려볼게요.", firstSectionQuestions + 1, "카테고리 선택", VisibleType.ALWAYS, null, "아루와 함께 한 기억을 떠올려볼게요.", firstSectionQuestions ); // Section 2 @@ -50,7 +50,7 @@ public static TemplateResponse templateResponse() { 2, true, "커뮤니케이션, 협업 능력에서 어떤 부분이 인상 깊었는지 선택해주세요.", - QuestionType.CHECKBOX.name(), + QuestionType.CHECKBOX, new OptionGroupResponse(2, 1, 3, secondSectionOptions), false, null @@ -59,14 +59,14 @@ public static TemplateResponse templateResponse() { 3, true, "위에서 선택한 사항에 대해 조금 더 자세히 설명해주세요.", - QuestionType.TEXT.name(), + QuestionType.TEXT, null, true, "상황을 자세하게 기록할수록 아루에게 도움이 돼요. 아루 덕분에 팀이 원활한 소통을 이뤘거나, 함께 일하면서 배울 점이 있었는지 떠올려 보세요." ) ); SectionResponse secondSection = new SectionResponse( - 2, "커뮤니케이션 능력", VisibleType.ALWAYS.name(), 1L, "아루의 커뮤니케이션, 협업 능력을 평가해주세요.", secondSectionQuestions + 2, "커뮤니케이션 능력", VisibleType.ALWAYS, 1L, "아루의 커뮤니케이션, 협업 능력을 평가해주세요.", secondSectionQuestions ); return new TemplateResponse(1, "아루", "리뷰미", List.of(firstSection, secondSection)); From 6548afe93bf369d1019870a3ad16875225162fc7 Mon Sep 17 00:00:00 2001 From: donghoony Date: Thu, 19 Dec 2024 03:16:05 +0900 Subject: [PATCH 3/3] =?UTF-8?q?style:=20=EA=B0=9C=ED=96=89=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/main/java/reviewme/template/domain/OptionType.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/src/main/java/reviewme/template/domain/OptionType.java b/backend/src/main/java/reviewme/template/domain/OptionType.java index 80e4e2c1b..cf20adc26 100644 --- a/backend/src/main/java/reviewme/template/domain/OptionType.java +++ b/backend/src/main/java/reviewme/template/domain/OptionType.java @@ -1,6 +1,8 @@ package reviewme.template.domain; public enum OptionType { + CATEGORY, KEYWORD, + ; }