|
5 | 5 | import com.leets7th.job_is_be.domain.job.dto.JobSummaryResponse; |
6 | 6 | import com.leets7th.job_is_be.domain.job.service.JobService; |
7 | 7 | import com.leets7th.job_is_be.global.response.ApiResponse; |
| 8 | +import com.leets7th.job_is_be.global.response.PageResponse; |
8 | 9 | import com.leets7th.job_is_be.global.status.SuccessStatus; |
9 | 10 | import io.swagger.v3.oas.annotations.Operation; |
10 | 11 | import io.swagger.v3.oas.annotations.Parameter; |
@@ -47,23 +48,23 @@ public ResponseEntity<ApiResponse<Void>> unsaveJob( |
47 | 48 |
|
48 | 49 | // 공고 탐색 및 검색 |
49 | 50 | @Operation(summary = "공고 탐색 및 검색", description = "필터 조건(직군, 지역, 경력 등)과 키워드를 기반으로 공고 목록을 페이징 조회합니다.") |
50 | | - @GetMapping("/search") |
51 | | - public ResponseEntity<Page<JobSummaryResponse>> searchJobs( |
| 51 | + @GetMapping |
| 52 | + public ResponseEntity<ApiResponse<PageResponse<JobSummaryResponse>>> searchJobs( |
52 | 53 | @Valid @ModelAttribute @ParameterObject JobSearchRequest condition, |
53 | 54 | @PageableDefault(page = 0, size = 24, sort = {"createdAt", "id"}, direction = Sort.Direction.DESC) |
54 | 55 | @ParameterObject Pageable pageable |
55 | 56 | ) { |
56 | 57 | Page<JobSummaryResponse> response = jobService.searchJobs(condition, pageable); |
57 | | - return ResponseEntity.ok(response); |
| 58 | + return ApiResponse.success(SuccessStatus.JOB_SEARCH_SUCCESS, PageResponse.from(response)); |
58 | 59 | } |
59 | 60 |
|
60 | | - //공고 상세 조회 |
| 61 | + // 공고 상세 조회 |
61 | 62 | @Operation(summary = "공고 상세 조회", description = "공고 ID를 통해 특정 공고의 상세 정보를 조회합니다.") |
62 | 63 | @GetMapping("/{jobId}") |
63 | | - public ResponseEntity<JobDetailResponse> getJobDetail( |
| 64 | + public ResponseEntity<ApiResponse<JobDetailResponse>> getJobDetail( |
64 | 65 | @Parameter(description = "공고 ID") @PathVariable Long jobId |
65 | 66 | ) { |
66 | 67 | JobDetailResponse response = jobService.getJobDetail(jobId); |
67 | | - return ResponseEntity.ok(response); |
| 68 | + return ApiResponse.success(SuccessStatus.JOB_DETAIL_SUCCESS, response); |
68 | 69 | } |
69 | 70 | } |
0 commit comments