-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCommonJobPostingController.java
More file actions
71 lines (62 loc) · 2.7 KB
/
CommonJobPostingController.java
File metadata and controls
71 lines (62 loc) · 2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package com.ctrls.auto_enter_view.controller;
import com.ctrls.auto_enter_view.dto.common.JobPostingDetailDto;
import com.ctrls.auto_enter_view.dto.common.MainJobPostingDto;
import com.ctrls.auto_enter_view.enums.Education;
import com.ctrls.auto_enter_view.enums.JobCategory;
import com.ctrls.auto_enter_view.enums.TechStack;
import com.ctrls.auto_enter_view.service.JobPostingService;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/common/job-postings")
@RequiredArgsConstructor
@RestController
public class CommonJobPostingController {
private final JobPostingService jobPostingService;
/**
* Main 화면에 보여질 채용 공고 전체 조회하기
*
* @param page 페이징 처리 시 page 시작 1
* @param size 페이징 처리 시 한번에 가져오는 size 24
* @return MainJobPostingDto.Response
*/
@GetMapping
public ResponseEntity<MainJobPostingDto.Response> getAllJobPosting(
@RequestParam(defaultValue = "1") int page,
@RequestParam(defaultValue = "24") int size) {
MainJobPostingDto.Response response = jobPostingService.getAllJobPosting(page, size);
return ResponseEntity.ok(response);
}
/**
* 채용 공고 상세 조회하기
*
* @param jobPostingKey 채용 공고 PK
* @return JobPostingDetailDto.Response
*/
@GetMapping("/{jobPostingKey}")
public ResponseEntity<JobPostingDetailDto.Response> getDetailJobPosting(
@PathVariable String jobPostingKey) {
JobPostingDetailDto.Response response = jobPostingService.getJobPostingDetail(jobPostingKey);
return ResponseEntity.ok(response);
}
@GetMapping("/search")
public ResponseEntity<MainJobPostingDto.Response> searchJobPosting(
@RequestParam(defaultValue = "1") int page,
@RequestParam(defaultValue = "24") int size,
@RequestParam(required = false) JobCategory jobCategory,
@RequestParam(required = false) List<TechStack> techStacks,
@RequestParam(required = false) String employmentType,
@RequestParam(required = false) Integer minCareer,
@RequestParam(required = false) Integer maxCareer,
@RequestParam(required = false) Education education
) {
MainJobPostingDto.Response response = jobPostingService.searchJobPosting(page, size,
jobCategory, techStacks, employmentType, minCareer, maxCareer, education);
return ResponseEntity.ok(response);
}
}