Skip to content

Commit

Permalink
πŸš€ :: 1.2.19
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyoil2 committed Nov 20, 2024
2 parents 33297bd + d15d2de commit 6f1f8b7
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,4 @@ public class ApplicationFilter {
private final String studentName;
private final Boolean winterIntern;
private final Year year;
private final Long page;
@Builder.Default
private int limit = 10;

public Long getOffset() {
return (page - 1) * limit;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,14 @@ public TeacherQueryApplicationsResponse execute(
String studentName,
Long recruitmentId,
Boolean winterIntern,
Year year,
Long page
Year year
) {
ApplicationFilter applicationFilter = ApplicationFilter.builder()
.recruitmentId(recruitmentId)
.applicationStatus(applicationStatus)
.studentName(studentName)
.winterIntern(winterIntern)
.year(year)
.page(page)
.build();

List<ApplicationVO> applicationVOs = queryApplicationPort.getAllByConditions(applicationFilter);
Expand All @@ -56,8 +54,6 @@ public ApplicationCountResponse countApplications(
.studentName(studentName)
.winterIntern(winterIntern)
.year(year)
.page(1L)
.limit(1000)
.build();

List<ApplicationVO> applicationVOs = queryApplicationPort.getAllByConditions(applicationFilter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ public List<ApplicationVO> getAllByConditions(ApplicationFilter filter) {
applicationEntity.createdAt.desc()
);

if (filter.getPage() != null) {
query.offset(filter.getOffset())
.limit(filter.getLimit());
}
return query
.transform(
groupBy(applicationEntity.id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,9 @@ public TeacherQueryApplicationsResponse queryTeacherApplicationList(
@RequestParam(value = "student_name", required = false) String studentName,
@RequestParam(value = "recruitment_id", required = false) Long recruitmentId,
@RequestParam(value = "winter_intern", required = false) Boolean winterIntern,
@RequestParam(required = false) @DateTimeFormat(pattern = "yyyy") Year year,
@RequestParam(value = "page", required = false, defaultValue = "1") @Positive Long page
@RequestParam(required = false) @DateTimeFormat(pattern = "yyyy") Year year
) {
return queryApplicationListService.execute(applicationStatus, studentName, recruitmentId, winterIntern, year, page);
return queryApplicationListService.execute(applicationStatus, studentName, recruitmentId, winterIntern, year);
}

@Cacheable
Expand Down

0 comments on commit 6f1f8b7

Please sign in to comment.