diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/application/spi/QueryApplicationPort.java b/jobis-application/src/main/java/team/retum/jobis/domain/application/spi/QueryApplicationPort.java index 1e24bbe2b..69afcb98d 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/application/spi/QueryApplicationPort.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/application/spi/QueryApplicationPort.java @@ -12,7 +12,7 @@ public interface QueryApplicationPort { - List queryApplicationByConditions(Long recruitmentId, Long studentId, ApplicationStatus applicationStatus, String studentName, Long page); + List queryApplicationByConditions(Long recruitmentId, Long studentId, ApplicationStatus applicationStatus, String studentName); Long queryApplicationCountByCondition(ApplicationStatus applicationStatus, String studentName); diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/application/usecase/CompanyQueryApplicationsUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/application/usecase/CompanyQueryApplicationsUseCase.java index a1c55187b..ba7ab5a56 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/application/usecase/CompanyQueryApplicationsUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/application/usecase/CompanyQueryApplicationsUseCase.java @@ -22,7 +22,7 @@ public class CompanyQueryApplicationsUseCase { private final QueryRecruitmentPort queryRecruitmentPort; private final SecurityPort securityPort; - public CompanyQueryApplicationsResponse execute(Long page) { + public CompanyQueryApplicationsResponse execute() { Company company = securityPort.getCurrentCompany(); Recruitment recruitment = queryRecruitmentPort.queryRecentRecruitmentByCompanyId(company.getId()) @@ -30,7 +30,7 @@ public CompanyQueryApplicationsResponse execute(Long page) { return new CompanyQueryApplicationsResponse( queryApplicationPort.queryApplicationByConditions( - recruitment.getId(), null, ApplicationStatus.SEND, null, page + recruitment.getId(), null, ApplicationStatus.SEND, null ).stream() .map(application -> CompanyQueryApplicationResponse.builder() .applicationId(application.getId()) diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/application/usecase/QueryMyApplicationsUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/application/usecase/QueryMyApplicationsUseCase.java index 474406fed..6a0df61fa 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/application/usecase/QueryMyApplicationsUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/application/usecase/QueryMyApplicationsUseCase.java @@ -16,12 +16,13 @@ public class QueryMyApplicationsUseCase { private final QueryApplicationPort queryApplicationPort; private final SecurityPort securityPort; - public QueryMyApplicationsResponse execute(Long page) { + public QueryMyApplicationsResponse execute() { Student student = securityPort.getCurrentStudent(); return new QueryMyApplicationsResponse( queryApplicationPort.queryApplicationByConditions( - null, student.getId(), null, null, page).stream() + null, student.getId(), null, null + ).stream() .map(application -> QueryMyApplicationResponse.builder() .applicationId(application.getId()) .recruitmentId(application.getRecruitmentId()) diff --git a/jobis-application/src/main/java/team/retum/jobis/domain/application/usecase/TeacherQueryApplicationsUseCase.java b/jobis-application/src/main/java/team/retum/jobis/domain/application/usecase/TeacherQueryApplicationsUseCase.java index ba0eeb514..bdb4bcce0 100644 --- a/jobis-application/src/main/java/team/retum/jobis/domain/application/usecase/TeacherQueryApplicationsUseCase.java +++ b/jobis-application/src/main/java/team/retum/jobis/domain/application/usecase/TeacherQueryApplicationsUseCase.java @@ -17,10 +17,10 @@ public class TeacherQueryApplicationsUseCase { private final QueryApplicationPort applicationPersistenceAdapter; - public TeacherQueryApplicationsResponse execute(ApplicationStatus applicationStatus, String studentName, Long recruitmentId, Long page) { + public TeacherQueryApplicationsResponse execute(ApplicationStatus applicationStatus, String studentName, Long recruitmentId) { return new TeacherQueryApplicationsResponse( applicationPersistenceAdapter.queryApplicationByConditions( - recruitmentId, null, applicationStatus, studentName, page + recruitmentId, null, applicationStatus, studentName ).stream() .map(application -> TeacherQueryApplicationResponse.builder() .applicationId(application.getId()) diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/persistence/ApplicationPersistenceAdapter.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/persistence/ApplicationPersistenceAdapter.java index 5e4c5b476..5e4022217 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/persistence/ApplicationPersistenceAdapter.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/persistence/ApplicationPersistenceAdapter.java @@ -47,8 +47,7 @@ public List queryApplicationByConditions( Long recruitmentId, Long studentId, ApplicationStatus applicationStatus, - String studentName, - Long page + String studentName ) { return queryFactory .selectFrom(applicationEntity) @@ -62,8 +61,6 @@ public List queryApplicationByConditions( eqApplicationStatus(applicationStatus), containStudentName(studentName) ) - .offset(page * 11) - .limit(11) .orderBy(applicationEntity.createdAt.desc()) .transform( groupBy(applicationEntity.id) diff --git a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/presentation/ApplicationWebAdapter.java b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/presentation/ApplicationWebAdapter.java index 865f6424b..c45ca56b2 100644 --- a/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/presentation/ApplicationWebAdapter.java +++ b/jobis-infrastructure/src/main/java/team/retum/jobis/domain/application/presentation/ApplicationWebAdapter.java @@ -77,10 +77,9 @@ public void deleteApplication(@PathVariable("application-id") Long applicationId public TeacherQueryApplicationsResponse queryTeacherApplicationList( @RequestParam(value = "application_status", required = false) ApplicationStatus applicationStatus, @RequestParam(value = "student_name", required = false) String studentName, - @RequestParam(value = "recruitment_id", required = false) Long recruitmentId, - @RequestParam(value = "page", required = false, defaultValue = "1") @Positive Long page + @RequestParam(value = "recruitment_id", required = false) Long recruitmentId ) { - return queryApplicationListService.execute(applicationStatus, studentName, recruitmentId, page - 1); + return queryApplicationListService.execute(applicationStatus, studentName, recruitmentId); } @GetMapping("/count") @@ -92,17 +91,13 @@ public TotalPageCountResponse queryApplicationCount( } @GetMapping("/company") - public CompanyQueryApplicationsResponse queryCompanyApplicationList( - @RequestParam(value = "page", required = false, defaultValue = "1") @Positive Long page - ) { - return companyQueryApplicationsUseCase.execute(page - 1); + public CompanyQueryApplicationsResponse queryCompanyApplicationList() { + return companyQueryApplicationsUseCase.execute(); } @GetMapping("/students") - public QueryMyApplicationsResponse queryMyApplications( - @RequestParam(value = "page", required = false, defaultValue = "1") @Positive Long page - ) { - return queryMyApplicationsUseCase.execute(page - 1); + public QueryMyApplicationsResponse queryMyApplications() { + return queryMyApplicationsUseCase.execute(); } @ResponseStatus(HttpStatus.NO_CONTENT)