From 474219da310487cf3b80205e3e922215b6838334 Mon Sep 17 00:00:00 2001 From: unanchoi Date: Sun, 14 Jan 2024 11:47:47 +0900 Subject: [PATCH] =?UTF-8?q?[FIX]=20IntervieweePart=20ALL=EC=9D=B8=20?= =?UTF-8?q?=EA=B2=BD=EC=9A=B0=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../startlionserver/controller/InterviewController.java | 2 ++ .../startlionserver/domain/enums/IntervieweePart.java | 6 ++++++ .../dto/response/interview/InterviewDetailResponse.java | 2 ++ .../dto/response/interview/InterviewResponse.java | 5 ++++- .../startlionserver/dto/response/part/PartResponse.java | 2 ++ .../repository/InterviewQueryRepository.java | 8 ++++++++ src/main/resources/application-dev.yaml | 2 +- 7 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/startlion/startlionserver/controller/InterviewController.java b/src/main/java/com/startlion/startlionserver/controller/InterviewController.java index 593547b..22a06df 100644 --- a/src/main/java/com/startlion/startlionserver/controller/InterviewController.java +++ b/src/main/java/com/startlion/startlionserver/controller/InterviewController.java @@ -19,6 +19,8 @@ public class InterviewController implements InterviewApi { private final InterviewService interviewService; + + // ALL, DEV, DESIGN, BE, FE, PM @GetMapping public ResponseEntity> getInterviews(@RequestParam(required = false) String part) { val response = interviewService.getInterviews(part); diff --git a/src/main/java/com/startlion/startlionserver/domain/enums/IntervieweePart.java b/src/main/java/com/startlion/startlionserver/domain/enums/IntervieweePart.java index 8aa3d2f..31cccf7 100644 --- a/src/main/java/com/startlion/startlionserver/domain/enums/IntervieweePart.java +++ b/src/main/java/com/startlion/startlionserver/domain/enums/IntervieweePart.java @@ -3,6 +3,8 @@ import lombok.Getter; import lombok.RequiredArgsConstructor; +import java.util.List; + @Getter @RequiredArgsConstructor public enum IntervieweePart { @@ -13,4 +15,8 @@ public enum IntervieweePart { DEV("DEV"); private final String name; + + public static List getAllPart() { + return List.of(PM, FE, BE, DESIGN, DEV); + } } diff --git a/src/main/java/com/startlion/startlionserver/dto/response/interview/InterviewDetailResponse.java b/src/main/java/com/startlion/startlionserver/dto/response/interview/InterviewDetailResponse.java index c4bf389..39d6c8c 100644 --- a/src/main/java/com/startlion/startlionserver/dto/response/interview/InterviewDetailResponse.java +++ b/src/main/java/com/startlion/startlionserver/dto/response/interview/InterviewDetailResponse.java @@ -1,6 +1,7 @@ package com.startlion.startlionserver.dto.response.interview; +import com.fasterxml.jackson.annotation.JsonProperty; import com.startlion.startlionserver.domain.entity.GraduateInterview; import com.startlion.startlionserver.dto.response.interviewanswer.InterviewAnswerResponse; import io.swagger.v3.oas.annotations.media.Schema; @@ -26,6 +27,7 @@ public record InterviewDetailResponse( String major, @Schema(description = "인터뷰 대상자 image url") + @JsonProperty("imgUrl") String imageUrl, List interviewAnswers ) { diff --git a/src/main/java/com/startlion/startlionserver/dto/response/interview/InterviewResponse.java b/src/main/java/com/startlion/startlionserver/dto/response/interview/InterviewResponse.java index f0fb587..ef3492a 100644 --- a/src/main/java/com/startlion/startlionserver/dto/response/interview/InterviewResponse.java +++ b/src/main/java/com/startlion/startlionserver/dto/response/interview/InterviewResponse.java @@ -1,6 +1,7 @@ package com.startlion.startlionserver.dto.response.interview; +import com.fasterxml.jackson.annotation.JsonProperty; import com.startlion.startlionserver.domain.entity.GraduateInterview; import io.swagger.v3.oas.annotations.media.Schema; @@ -16,7 +17,9 @@ public record InterviewResponse( @Schema(description = "인터뷰 목록 페이지에서 사용하는 섬네일 텍스트") String oneLineContent, - @Schema(description = "인터뷰 대상자 imageUrl") String imageUrl + @Schema(description = "인터뷰 대상자 imageUrl") + @JsonProperty("imgUrl") + String imageUrl ) { public static InterviewResponse of(GraduateInterview graduateInterview) { diff --git a/src/main/java/com/startlion/startlionserver/dto/response/part/PartResponse.java b/src/main/java/com/startlion/startlionserver/dto/response/part/PartResponse.java index 7a4ebfd..a5f49e2 100644 --- a/src/main/java/com/startlion/startlionserver/dto/response/part/PartResponse.java +++ b/src/main/java/com/startlion/startlionserver/dto/response/part/PartResponse.java @@ -1,5 +1,6 @@ package com.startlion.startlionserver.dto.response.part; +import com.fasterxml.jackson.annotation.JsonProperty; import com.startlion.startlionserver.domain.entity.CommonQuestion; import com.startlion.startlionserver.domain.entity.Curriculum; import com.startlion.startlionserver.domain.entity.Part; @@ -21,6 +22,7 @@ public record PartResponse( @Schema(description = "파트 타입", example = "기획") String typeOfTalent, @Schema(description = "파트 이미지 url", example = "https://startlion.s3.ap-northeast-2.amazonaws.com/part/plan.png") + @JsonProperty("imgUrl") String imageUrl, @Schema(description = "커리큘럼 내용", example = "기획 파트는 기획을 합니다.") String curriculumContents, diff --git a/src/main/java/com/startlion/startlionserver/repository/InterviewQueryRepository.java b/src/main/java/com/startlion/startlionserver/repository/InterviewQueryRepository.java index fc10fe3..f32de28 100644 --- a/src/main/java/com/startlion/startlionserver/repository/InterviewQueryRepository.java +++ b/src/main/java/com/startlion/startlionserver/repository/InterviewQueryRepository.java @@ -29,6 +29,14 @@ BooleanExpression eqPart(String part) { return null; } + if (part == "ALL") { + return graduateInterview.part.eq(IntervieweePart.PM) + .or(graduateInterview.part.eq(IntervieweePart.FE)) + .or(graduateInterview.part.eq(IntervieweePart.BE)) + .or(graduateInterview.part.eq(IntervieweePart.DESIGN)) + .or(graduateInterview.part.eq(IntervieweePart.DEV)); + } + return graduateInterview.part.eq(IntervieweePart.valueOf(part)); } } diff --git a/src/main/resources/application-dev.yaml b/src/main/resources/application-dev.yaml index 5b5950b..ea65762 100644 --- a/src/main/resources/application-dev.yaml +++ b/src/main/resources/application-dev.yaml @@ -12,7 +12,7 @@ spring: jpa: hibernate: - ddl-auto: none + ddl-auto: create-drop properties: hibernate: dialect: org.hibernate.dialect.MySQLDialect