|
1 | | -package org.ject.support.domain.admin.controller; |
| 1 | +package org.ject.support.admin.apply.controller; |
2 | 2 |
|
3 | 3 | import jakarta.validation.Valid; |
4 | 4 | import lombok.RequiredArgsConstructor; |
5 | | -import org.ject.support.domain.admin.dto.SubmittedApplyBulkDeleteRequest; |
6 | | -import org.ject.support.domain.admin.dto.SubmittedApplyCountResponse; |
7 | | -import org.ject.support.domain.admin.dto.SubmittedApplyDetailResponse; |
8 | | -import org.ject.support.domain.admin.dto.SubmittedApplyEditRequest; |
9 | | -import org.ject.support.domain.admin.dto.SubmittedApplyResponse; |
10 | | -import org.ject.support.domain.admin.service.SubmittedApplyService; |
| 5 | +import org.ject.support.admin.apply.dto.SubmittedApplyBulkDeleteRequest; |
| 6 | +import org.ject.support.admin.apply.dto.SubmittedApplyCountResponse; |
| 7 | +import org.ject.support.admin.apply.dto.SubmittedApplyDetailResponse; |
| 8 | +import org.ject.support.admin.apply.dto.SubmittedApplyEditRequest; |
| 9 | +import org.ject.support.admin.apply.dto.SubmittedApplyResponse; |
| 10 | +import org.ject.support.admin.apply.service.SubmittedApplyService; |
11 | 11 | import org.ject.support.domain.member.JobFamily; |
| 12 | +import org.ject.support.domain.recruit.domain.RecruitType; |
12 | 13 | import org.springframework.data.domain.Page; |
13 | 14 | import org.springframework.data.domain.Pageable; |
| 15 | +import org.springframework.data.domain.Sort; |
14 | 16 | import org.springframework.data.web.PageableDefault; |
15 | 17 | import org.springframework.web.bind.annotation.DeleteMapping; |
16 | 18 | import org.springframework.web.bind.annotation.GetMapping; |
|
21 | 23 | import org.springframework.web.bind.annotation.RequestParam; |
22 | 24 | import org.springframework.web.bind.annotation.RestController; |
23 | 25 |
|
| 26 | +import io.swagger.v3.oas.annotations.Operation; |
| 27 | +import io.swagger.v3.oas.annotations.tags.Tag; |
| 28 | + |
24 | 29 | @RestController |
25 | | -@RequestMapping("/admin/submitted-applies") |
26 | 30 | @RequiredArgsConstructor |
27 | | -public class SubmittedApplyController implements SubmittedApplyApiSpec { |
| 31 | +@RequestMapping("/admin/submitted-applies") |
| 32 | +@Tag(name = "Submitted Apply", description = "[관리자] 제출된 지원서 관리 API") |
| 33 | +public class SubmittedApplyController { |
28 | 34 |
|
29 | 35 | private final SubmittedApplyService submittedApplyService; |
30 | 36 |
|
31 | | - @Override |
32 | 37 | @GetMapping("/count") |
| 38 | + @Operation( |
| 39 | + summary = "제출된 지원서 수 조회", |
| 40 | + description = "제출된 상태의 지원서 총 개수를 조회합니다.") |
33 | 41 | public SubmittedApplyCountResponse getSubmittedApplyCount() { |
34 | 42 | return submittedApplyService.countSubmittedApply(); |
35 | 43 | } |
36 | 44 |
|
37 | | - @Override |
38 | 45 | @GetMapping |
39 | | - public Page<SubmittedApplyResponse> findSubmittedApplies(@RequestParam(required = false) final JobFamily jobFamily, |
40 | | - @RequestParam(required = false) final Long semesterId, |
41 | | - @PageableDefault(size = 15) final Pageable pageable) { |
42 | | - return submittedApplyService.findSubmittedApplies(jobFamily, semesterId, pageable); |
| 46 | + @Operation( |
| 47 | + summary = "제출된 지원서 목록 조회", |
| 48 | + description = "제출된 지원서들의 목록을 조회합니다.") |
| 49 | + public Page<SubmittedApplyResponse> findSubmittedApplies(@RequestParam(required = false) final Long semesterId, |
| 50 | + @RequestParam(required = false) final JobFamily jobFamily, |
| 51 | + @RequestParam(required = false) final RecruitType recruitType, |
| 52 | + @PageableDefault(size = 10, sort = "createdAt", direction = Sort.Direction.DESC) final Pageable pageable) { |
| 53 | + return submittedApplyService.findSubmittedApplies(jobFamily, semesterId, recruitType, pageable); |
43 | 54 | } |
44 | 55 |
|
45 | | - @Override |
46 | 56 | @GetMapping("/{applyId}") |
| 57 | + @Operation( |
| 58 | + summary = "제출된 지원서 상세 조회", |
| 59 | + description = "전달한 ID에 해당하는 제출된 지원서의 상세 정보를 조회합니다.") |
47 | 60 | public SubmittedApplyDetailResponse findSubmittedApplyDetail(@PathVariable("applyId") final Long applyId) { |
48 | 61 | return submittedApplyService.findSubmittedApplyDetail(applyId); |
49 | 62 | } |
50 | 63 |
|
51 | | - @Override |
52 | 64 | @PutMapping("/{applyId}") |
| 65 | + @Operation( |
| 66 | + summary = "제출된 지원서 수정", |
| 67 | + description = "전달한 ID에 해당하는 제출된 지원서의 정보를 수정 합니다.") |
53 | 68 | public void editSubmittedApply(@PathVariable("applyId") final Long applyId, |
54 | 69 | @RequestBody @Valid final SubmittedApplyEditRequest request) { |
55 | 70 | submittedApplyService.updateSubmittedApply(applyId, request); |
56 | 71 | } |
57 | 72 |
|
58 | | - @Override |
59 | 73 | @DeleteMapping("/{applyId}") |
| 74 | + @Operation( |
| 75 | + summary = "제출된 지원서 삭제", |
| 76 | + description = "선택한 제출된 지원서를 삭제합니다.") |
60 | 77 | public void deleteSubmittedApply(@PathVariable("applyId") final Long applyId) { |
61 | 78 | submittedApplyService.deleteSubmittedApply(applyId); |
62 | 79 | } |
63 | 80 |
|
64 | | - @Override |
65 | 81 | @DeleteMapping |
| 82 | + @Operation( |
| 83 | + summary = "제출된 지원서 다수 삭제", |
| 84 | + description = "선택한 다수의 제출된 지원서들을 삭제합니다. 삭제한 수를 반환합니다.") |
66 | 85 | public int deleteSubmittedApplies(@RequestBody @Valid final SubmittedApplyBulkDeleteRequest request) { |
67 | 86 | return submittedApplyService.deleteSubmittedApplies(request.applyIds()); |
68 | 87 | } |
|
0 commit comments