Skip to content

Commit

Permalink
[FIX] IntervieweePart ALL인 경우 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
unanchoi committed Jan 14, 2024
1 parent dc6b9b6 commit 474219d
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public class InterviewController implements InterviewApi {

private final InterviewService interviewService;


// ALL, DEV, DESIGN, BE, FE, PM
@GetMapping
public ResponseEntity<List<InterviewResponse>> getInterviews(@RequestParam(required = false) String part) {
val response = interviewService.getInterviews(part);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.List;

@Getter
@RequiredArgsConstructor
public enum IntervieweePart {
Expand All @@ -13,4 +15,8 @@ public enum IntervieweePart {
DEV("DEV");

private final String name;

public static List<IntervieweePart> getAllPart() {
return List.of(PM, FE, BE, DESIGN, DEV);
}
}
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -26,6 +27,7 @@ public record InterviewDetailResponse(
String major,

@Schema(description = "인터뷰 대상자 image url")
@JsonProperty("imgUrl")
String imageUrl,
List<InterviewAnswerResponse> interviewAnswers
) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
2 changes: 1 addition & 1 deletion src/main/resources/application-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spring:

jpa:
hibernate:
ddl-auto: none
ddl-auto: create-drop
properties:
hibernate:
dialect: org.hibernate.dialect.MySQLDialect
Expand Down

0 comments on commit 474219d

Please sign in to comment.