-
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.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Kwoun Ki Ho <73146678+Chocochip101@users.noreply.github.com> Co-authored-by: 최가희 <60508828+cutehumanS2@users.noreply.github.com> Co-authored-by: Do Yeop Kim <113661364+Dobby-Kim@users.noreply.github.com>
- Loading branch information
1 parent
5de1fa6
commit 24312fa
Showing
35 changed files
with
502 additions
and
165 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
backend/src/main/java/com/cruru/applicant/domain/dto/ApplicantCard.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,25 @@ | ||
package com.cruru.applicant.domain.dto; | ||
|
||
import com.cruru.applicant.controller.response.ApplicantCardResponse; | ||
import java.time.LocalDateTime; | ||
|
||
public record ApplicantCard( | ||
long id, | ||
|
||
String name, | ||
|
||
LocalDateTime createdAt, | ||
|
||
Boolean isRejected, | ||
|
||
long evaluationCount, | ||
|
||
double averageScore, | ||
|
||
long processId | ||
) { | ||
|
||
public ApplicantCardResponse toResponse() { | ||
return new ApplicantCardResponse(id, name, createdAt, isRejected, (int) evaluationCount, averageScore); | ||
} | ||
} |
30 changes: 28 additions & 2 deletions
30
backend/src/main/java/com/cruru/applicant/domain/repository/ApplicantRepository.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 |
---|---|---|
@@ -1,16 +1,42 @@ | ||
package com.cruru.applicant.domain.repository; | ||
|
||
import com.cruru.applicant.domain.Applicant; | ||
import com.cruru.applicant.domain.dto.ApplicantCard; | ||
import com.cruru.dashboard.domain.Dashboard; | ||
import com.cruru.process.domain.Process; | ||
import java.util.List; | ||
import java.util.Optional; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.query.Param; | ||
|
||
public interface ApplicantRepository extends JpaRepository<Applicant, Long> { | ||
|
||
List<Applicant> findAllByProcess(Process process); | ||
|
||
long countByProcess(Process process); | ||
|
||
Optional<Applicant> findByEmail(String email); | ||
@Query(""" | ||
SELECT new com.cruru.applicant.domain.dto.ApplicantCard( | ||
a.id, a.name, a.createdDate, a.isRejected, COUNT(e), COALESCE(AVG(e.score), 0.00), a.process.id | ||
) | ||
FROM Applicant a | ||
LEFT JOIN Evaluation e ON e.applicant = a | ||
WHERE a.process IN :processes | ||
GROUP BY a.id, a.name, a.createdDate, a.isRejected, a.process.id | ||
""") | ||
List<ApplicantCard> findApplicantCardsByProcesses(@Param("processes") List<Process> processes); | ||
|
||
@Query(""" | ||
SELECT new com.cruru.applicant.domain.dto.ApplicantCard( | ||
a.id, a.name, a.createdDate, a.isRejected, COUNT(e), COALESCE(AVG(e.score), 0.00), a.process.id | ||
) | ||
FROM Applicant a | ||
LEFT JOIN Evaluation e ON e.applicant = a | ||
WHERE a.process = :process | ||
GROUP BY a.id, a.name, a.createdDate, a.isRejected | ||
""") | ||
List<ApplicantCard> findApplicantCardsByProcess(@Param("process") Process process); | ||
|
||
@Query("SELECT a FROM Applicant a JOIN FETCH a.process p JOIN FETCH p.dashboard d WHERE d = :dashboard") | ||
List<Applicant> findAllByDashboard(@Param("dashboard") Dashboard dashboard); | ||
} |
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
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
7 changes: 7 additions & 0 deletions
7
backend/src/main/java/com/cruru/dashboard/domain/DashboardApplyFormDto.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,7 @@ | ||
package com.cruru.dashboard.domain; | ||
|
||
import com.cruru.applyform.domain.ApplyForm; | ||
|
||
public record DashboardApplyFormDto(Dashboard dashboard, ApplyForm applyForm) { | ||
|
||
} |
3 changes: 0 additions & 3 deletions
3
backend/src/main/java/com/cruru/dashboard/domain/repository/DashboardRepository.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 |
---|---|---|
@@ -1,11 +1,8 @@ | ||
package com.cruru.dashboard.domain.repository; | ||
|
||
import com.cruru.club.domain.Club; | ||
import com.cruru.dashboard.domain.Dashboard; | ||
import java.util.List; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface DashboardRepository extends JpaRepository<Dashboard, Long> { | ||
|
||
List<Dashboard> findAllByClub(Club club); | ||
} |
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
2 changes: 1 addition & 1 deletion
2
backend/src/main/java/com/cruru/email/controller/EmailController.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
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.