-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BE] Release-HotFix: Cruru v1.1.1 (#768)
82a5d2d (HEAD -> be/main, origin/be/main) fix-be: OSIV 오류 해결 (#746) 7434b61 feat-be: 프로세스 목록 조회 API 필터링 및 정렬 구현 (#756) 2e05f2b feat-be: 다중 불합격자 해제 기능 구현 (#759) 4c60d92 feat-be: 대시보드 삭제 api 구현 (#749) fbbfee5 fix-be: 예외 처리 과정에서 NPE가 발생하지 않도록 수정 (#753) a55783d feat-be: 다중 불합격자 기능 구현 (#751) 071cebc chore-be(Actions-Prod): 무중단 배포 설정 수정
- Loading branch information
Showing
62 changed files
with
1,451 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
backend/src/main/java/com/cruru/applicant/controller/request/ApplicantsRejectRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.cruru.applicant.controller.request; | ||
|
||
import jakarta.validation.constraints.NotNull; | ||
import java.util.List; | ||
|
||
public record ApplicantsRejectRequest( | ||
@NotNull(message = "지원자 목록은 필수 값입니다.") | ||
List<Long> applicantIds | ||
) { | ||
|
||
} |
41 changes: 41 additions & 0 deletions
41
backend/src/main/java/com/cruru/applicant/domain/ApplicantSortOption.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.cruru.applicant.domain; | ||
|
||
import com.cruru.applicant.domain.dto.ApplicantCard; | ||
import com.cruru.applicant.exception.badrequest.ApplicantSortException; | ||
import java.util.Arrays; | ||
import java.util.Comparator; | ||
|
||
public enum ApplicantSortOption { | ||
|
||
ASC(Comparator.naturalOrder()), | ||
DESC(Comparator.reverseOrder()); | ||
|
||
private final Comparator<Comparable> comparator; | ||
|
||
ApplicantSortOption(Comparator<Comparable> comparator) { | ||
this.comparator = comparator; | ||
} | ||
|
||
public static Comparator<ApplicantCard> getCombinedComparator(String sortByCreatedAt, String sortByScore) { | ||
ApplicantSortOption createdAtOption = convertToSortOption(sortByCreatedAt); | ||
ApplicantSortOption scoreOption = convertToSortOption(sortByScore); | ||
|
||
return createdAtOption.getCreatedAtComparator() | ||
.thenComparing(scoreOption.getScoreComparator()); | ||
} | ||
|
||
private static ApplicantSortOption convertToSortOption(String sortOption) { | ||
return Arrays.stream(ApplicantSortOption.values()) | ||
.filter(option -> option.name().equalsIgnoreCase(sortOption)) | ||
.findAny() | ||
.orElseThrow(ApplicantSortException::new); | ||
} | ||
|
||
private Comparator<ApplicantCard> getCreatedAtComparator() { | ||
return Comparator.comparing(ApplicantCard::createdAt, comparator); | ||
} | ||
|
||
private Comparator<ApplicantCard> getScoreComparator() { | ||
return Comparator.comparing(ApplicantCard::averageScore, comparator); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
backend/src/main/java/com/cruru/applicant/domain/EvaluationStatus.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.cruru.applicant.domain; | ||
|
||
import com.cruru.applicant.domain.dto.ApplicantCard; | ||
import com.cruru.applicant.exception.badrequest.EvaluationStatusException; | ||
import java.util.Arrays; | ||
import java.util.function.Predicate; | ||
|
||
public enum EvaluationStatus { | ||
|
||
ALL(card -> true), | ||
NOT_EVALUATED(ApplicantCard::hasEvaluation), | ||
EVALUATED(ApplicantCard::hasNoEvaluation); | ||
|
||
private final Predicate<ApplicantCard> predicate; | ||
|
||
EvaluationStatus(Predicate<ApplicantCard> predicate) { | ||
this.predicate = predicate; | ||
} | ||
|
||
public static boolean matches(ApplicantCard card, String evaluationStatus) { | ||
return Arrays.stream(EvaluationStatus.values()) | ||
.filter(status -> status.name().equalsIgnoreCase(evaluationStatus)) | ||
.findAny() | ||
.orElseThrow(EvaluationStatusException::new) | ||
.predicate | ||
.test(card); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
backend/src/main/java/com/cruru/applicant/exception/badrequest/ApplicantSortException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.cruru.applicant.exception.badrequest; | ||
|
||
import com.cruru.advice.badrequest.BadRequestException; | ||
|
||
public class ApplicantSortException extends BadRequestException { | ||
|
||
private static final String MESSAGE = "지원하는 정렬 조건이 아닙니다."; | ||
|
||
public ApplicantSortException() { | ||
super(MESSAGE); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...end/src/main/java/com/cruru/applicant/exception/badrequest/EvaluationStatusException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.cruru.applicant.exception.badrequest; | ||
|
||
import com.cruru.advice.badrequest.BadRequestException; | ||
|
||
public class EvaluationStatusException extends BadRequestException { | ||
|
||
private static final String MESSAGE = "지원하는 평가 상태가 아닙니다."; | ||
|
||
public EvaluationStatusException() { | ||
super(MESSAGE); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.