Skip to content

Commit

Permalink
๐Ÿ”— :: (#436) page์— ์Œ์ˆ˜ ๋“ค์–ด์˜ค๋Š” ๋ฌธ์ œ
Browse files Browse the repository at this point in the history
  • Loading branch information
tedsoftj1123 authored Oct 17, 2023
2 parents 52f5f68 + 3b29e5f commit 0e6c122
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PathVariable;
Expand Down Expand Up @@ -38,8 +39,10 @@
import team.retum.jobis.domain.company.usecase.UpdateMouUseCase;

import javax.validation.Valid;
import javax.validation.constraints.Positive;

@RequiredArgsConstructor
@Validated
@RequestMapping("/companies")
@RestController
public class CompanyWebAdapter {
Expand Down Expand Up @@ -78,7 +81,7 @@ public void updateDetails(

@GetMapping("/student")
public StudentQueryCompaniesResponse studentQueryCompanies(
@RequestParam(value = "page", required = false, defaultValue = "1") Long page,
@RequestParam(value = "page", required = false, defaultValue = "1") @Positive Long page,
@RequestParam(value = "name", required = false) String name
) {
return studentQueryCompaniesUseCase.execute(page - 1, name);
Expand Down Expand Up @@ -112,7 +115,7 @@ public TeacherQueryEmployCompaniesResponse queryEmployCompanies(
@RequestParam(value = "company_name", required = false) String companyName,
@RequestParam(value = "company_type", required = false) CompanyType type,
@RequestParam(value = "year", required = false) Integer year,
@RequestParam(value = "page", defaultValue = "1") Long page
@RequestParam(value = "page", defaultValue = "1") @Positive Long page
) {
return teacherQueryEmployCompaniesUseCase.execute(companyName, type, year, page - 1);
}
Expand All @@ -132,7 +135,7 @@ public TeacherQueryCompaniesResponse queryCompanies(
@RequestParam(value = "name", required = false) String companyName,
@RequestParam(value = "region", required = false) String region,
@RequestParam(value = "business_area", required = false) Long businessArea,
@RequestParam(value = "page", defaultValue = "1") Long page
@RequestParam(value = "page", defaultValue = "1") @Positive Long page
) {
return teacherQueryCompaniesUseCase.execute(type, companyName, region, businessArea, page - 1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import lombok.RequiredArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.http.HttpStatus;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PatchMapping;
Expand Down Expand Up @@ -36,10 +37,12 @@
import team.retum.jobis.domain.recruitment.usecase.UpdateRecruitmentUseCase;

import javax.validation.Valid;
import javax.validation.constraints.Positive;
import java.time.LocalDate;
import java.util.List;

@RestController
@Validated
@RequiredArgsConstructor
@RequestMapping("/recruitments")
public class RecruitmentWebAdapter {
Expand Down Expand Up @@ -92,7 +95,7 @@ public void createRecruitArea(
@GetMapping("/student")
public StudentQueryRecruitmentsResponse studentQueryRecruitments(
@RequestParam(value = "name", required = false) String companyName,
@RequestParam(value = "page", required = false, defaultValue = "1") Long page,
@RequestParam(value = "page", required = false, defaultValue = "1") @Positive Long page,
@RequestParam(value = "job_code", required = false) Long jobCode,
@RequestParam(value = "tech_code", required = false) String techCode
) {
Expand All @@ -117,7 +120,7 @@ public TeacherQueryRecruitmentsResponse queryRecruitmentList(
@RequestParam(value = "end", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate end,
@RequestParam(value = "status", required = false) RecruitStatus status,
@RequestParam(value = "year", required = false) Integer year,
@RequestParam(value = "page", defaultValue = "1") Long page
@RequestParam(value = "page", defaultValue = "1") @Positive Long page
) {
return teacherQueryRecruitmentsUseCase.execute(companyName, start, end, year, status, page - 1);
}
Expand Down

0 comments on commit 0e6c122

Please sign in to comment.