Skip to content

Commit

Permalink
πŸ”— :: (864) μ·¨μ—… ν˜„ν™© μ½”λ“œ 리팩
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyoil2 authored Jan 20, 2025
2 parents 3b1e009 + 3bb4e6f commit 7ed1f16
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

import lombok.RequiredArgsConstructor;
import team.retum.jobis.common.annotation.ReadOnlyUseCase;
import static team.retum.jobis.domain.application.model.ApplicationStatus.FIELD_TRAIN;
import static team.retum.jobis.domain.application.model.ApplicationStatus.PASS;
import team.retum.jobis.domain.company.dto.response.EmploymentRatesResponse;
import team.retum.jobis.domain.company.dto.response.EmploymentRatesResponse.ClassResponse;
import team.retum.jobis.domain.company.spi.QueryCompanyPort;
import team.retum.jobis.domain.company.spi.vo.CompanyVO;
import team.retum.jobis.domain.student.spi.QueryStudentPort;
Expand All @@ -22,14 +21,14 @@ public class QueryEmploymentRateUseCase {
private static final Integer FOURTH_CLASS = 4;

public EmploymentRatesResponse execute() {
List<EmploymentRatesResponse.ClassResponse> classResponses = new ArrayList<>();
List<ClassResponse> classResponses = new ArrayList<>();

for (Integer classNum = FIRTH_CLASS; classNum <= FOURTH_CLASS; classNum++) {
List<CompanyVO> companies = queryCompanyPort.getEmploymentRateByClassNumber(classNum);
long totalStudents = queryStudentPort.getTotalStudentsByClassNumber(classNum);
long passedStudents = queryStudentPort.getPassedStudentsByClassNumber(classNum);

classResponses.add(new EmploymentRatesResponse.ClassResponse(classNum, companies, totalStudents, passedStudents));
classResponses.add(new ClassResponse(classNum, companies, totalStudents, passedStudents));
}

return new EmploymentRatesResponse(classResponses);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ public void teacherDeleteApplication(
teacherDeleteApplicationUseCase.execute(applicationIds);
}

@Cacheable
@GetMapping("/employment")
public EmploymentRatesResponse queryEmploymentRate() {
return queryEmploymentRateUseCase.execute();
Expand Down

0 comments on commit 7ed1f16

Please sign in to comment.