2121import org .springframework .http .ResponseEntity ;
2222import org .springframework .web .bind .annotation .*;
2323
24- import java .time .LocalDate ;
25- import java .time .LocalTime ;
2624import java .util .List ;
2725
2826@ RestController
@@ -38,25 +36,21 @@ public class RecruitController {
3836 // 지원하기
3937 @ Operation (summary = "부원 지원하기" )
4038 @ ApiResponses (value = {
41- @ ApiResponse (responseCode = "200" , description = "지원 성공" ),
42- @ ApiResponse (responseCode = "400" , description = "실패 케이스" ,
43- content = @ Content (
44- mediaType = "application/json" ,
45- schema = @ Schema (implementation = ErrorResponse .class ),
46- examples = {
47- @ ExampleObject (
48- name = "학번 중복" ,
49- value = "{ \" code\" : \" C013\" , \" message\" : \" 이미 등록된 학번입니다.\" }" ),
50- @ ExampleObject (
51- name = "모집 기간 아님" ,
52- value = "{ \" code\" : \" C029\" , \" message\" : \" 모집 기간이 아닙니다.\" }" )
53- }))
39+ @ ApiResponse (responseCode = "200" , description = "지원 성공" ),
40+ @ ApiResponse (responseCode = "400" , description = "실패 케이스" ,
41+ content = @ Content (
42+ mediaType = "application/json" ,
43+ schema = @ Schema (implementation = ErrorResponse .class ),
44+ examples = {
45+ @ ExampleObject (name = "학번 중복" , value = "{ \" code\" : \" C013\" , \" message\" : \" 이미 등록된 학번입니다.\" }" ),
46+ @ ExampleObject (name = "모집 기간 아님" , value = "{ \" code\" : \" C029\" , \" message\" : \" 모집 기간이 아닙니다.\" }" ),
47+ @ ExampleObject (name = "잘못된 요청 값" , value = "{ \" code\" : \" C007\" , \" message\" : \" 요청한 값이 올바르지 않습니다.\" }" )
48+ }))
5449 })
5550 @ PostMapping ("/apply" )
5651 public ResponseEntity <Void > apply (@ Valid @ RequestBody final ApplicantCreateRequestDto request ) {
5752 applicantService .apply (request );
58- return ResponseEntity .ok ()
59- .build ();
53+ return ResponseEntity .ok ().build ();
6054 }
6155
6256 // 모집 일정 조회
@@ -67,44 +61,46 @@ public ResponseEntity<List<RecruitConfigResponseDto>> getRecruitSchedule() {
6761 return ResponseEntity .ok (recruitService .getRecruitSchedule ());
6862 }
6963
70- /*
71- * 모집 일정 수정
72- * - 관리자가 모집 일정을 수정할 때 사용
73- * - RecruitService.modifyRecruitSchedule()을 호출하여 DB 반영
74- */
64+ // 모집 일정 수정
7565 @ Operation (summary = "모집 일정 수정" )
66+ @ ApiResponses (value = {
67+ @ ApiResponse (responseCode = "200" , description = "모집 일정 수정 성공" ),
68+ @ ApiResponse (responseCode = "400" , description = "실패 케이스" ,
69+ content = @ Content (
70+ mediaType = "application/json" ,
71+ schema = @ Schema (implementation = ErrorResponse .class ),
72+ examples = {
73+ @ ExampleObject (name = "잘못된 날짜 형식" , value = "{ \" code\" : \" C016\" , \" message\" : \" 날짜 형식이 올바르지 않습니다.\" }" ),
74+ @ ExampleObject (name = "잘못된 시간 형식" , value = "{ \" code\" : \" C017\" , \" message\" : \" 시간 형식이 올바르지 않습니다.\" }" ),
75+ @ ExampleObject (name = "잘못된 요청 값" , value = "{ \" code\" : \" C007\" , \" message\" : \" 요청한 값이 올바르지 않습니다.\" }" )
76+ }))
77+ })
7678 @ PutMapping ("/schedule" )
7779 public ResponseEntity <Void > modifyRecruitSchedule (@ RequestBody dmu .dasom .api .domain .recruit .dto .RecruitScheduleModifyRequestDto request ) {
7880 recruitService .modifyRecruitSchedule (request );
7981 return ResponseEntity .ok ().build ();
8082 }
8183
82- /*
83- * 모집 일정 초기화 (테스트용)
84- * - 테스트 시 초기화를 위해 전체 모집 일정을 초기 상태로 되돌림
85- * - RecruitService.initRecruitSchedule()을 호출
86- */
84+ // 모집 일정 초기화 (테스트용)
8785 @ Operation (summary = "TEMP: 모집 일정 초기화" )
8886 @ GetMapping ("/init-schedule" )
8987 public ResponseEntity <String > initSchedule () {
9088 recruitService .initRecruitSchedule ();
9189 return ResponseEntity .ok ("Recruit schedule initialized successfully." );
9290 }
9391
94-
9592 // 합격 결과 확인
9693 @ Operation (summary = "합격 결과 확인" )
9794 @ ApiResponses (value = {
98- @ ApiResponse (responseCode = "200" , description = "합격 결과 확인 성공" ),
99- @ ApiResponse (responseCode = "400" , description = "실패 케이스" ,
100- content = @ Content (
101- mediaType = "application/json" ,
102- schema = @ Schema (implementation = ErrorResponse .class ),
103- examples = {
104- @ ExampleObject (
105- name = "학번 조회 실패 혹은 전화번호 뒷자리 일치하지 않음" ,
106- value = "{ \" code\" : \" C007\" , \" message\" : \" 요청한 값이 올바르지 않습니다.\" }" )
107- }))
95+ @ ApiResponse (responseCode = "200" , description = "합격 결과 확인 성공" ),
96+ @ ApiResponse (responseCode = "400" , description = "실패 케이스" ,
97+ content = @ Content (
98+ mediaType = "application/json" ,
99+ schema = @ Schema (implementation = ErrorResponse .class ),
100+ examples = {
101+ @ ExampleObject (name = "지원자 없음" , value = "{ \" code\" : \" C022\" , \" message\" : \" 지원자를 찾을 수 없습니다.\" }" ),
102+ @ ExampleObject (name = "잘못된 요청 값" , value = "{ \" code\" : \" C007\" , \" message\" : \" 요청한 값이 올바르지 않습니다.\" }" )
103+ }))
108104 })
109105 @ GetMapping ("/result" )
110106 public ResponseEntity <ResultCheckResponseDto > checkResult (@ ModelAttribute final ResultCheckRequestDto request ) {
@@ -115,7 +111,17 @@ public ResponseEntity<ResultCheckResponseDto> checkResult(@ModelAttribute final
115111 @ Operation (summary = "면접 예약" , description = "지원자가 특정 면접 슬롯을 예약합니다." )
116112 @ ApiResponses (value = {
117113 @ ApiResponse (responseCode = "200" , description = "면접 예약 성공" ),
118- @ ApiResponse (responseCode = "400" , description = "잘못된 요청 데이터" )
114+ @ ApiResponse (responseCode = "400" , description = "실패 케이스" ,
115+ content = @ Content (
116+ mediaType = "application/json" ,
117+ schema = @ Schema (implementation = ErrorResponse .class ),
118+ examples = {
119+ @ ExampleObject (name = "지원자 없음" , value = "{ \" code\" : \" C022\" , \" message\" : \" 지원자를 찾을 수 없습니다.\" }" ),
120+ @ ExampleObject (name = "슬롯 없음" , value = "{ \" code\" : \" C021\" , \" message\" : \" 슬롯을 찾을 수 없습니다.\" }" ),
121+ @ ExampleObject (name = "이미 예약됨" , value = "{ \" code\" : \" C023\" , \" message\" : \" 이미 예약된 지원자입니다.\" }" ),
122+ @ ExampleObject (name = "슬롯 가득 참" , value = "{ \" code\" : \" C025\" , \" message\" : \" 해당 슬롯이 가득 찼습니다.\" }" ),
123+ @ ExampleObject (name = "슬롯 불가" , value = "{ \" code\" : \" C032\" , \" message\" : \" 해당 슬롯을 예약할 수 없습니다.\" }" )
124+ }))
119125 })
120126 @ PostMapping ("/interview/reserve" )
121127 public ResponseEntity <Void > reserveInterviewSlot (@ Valid @ RequestBody InterviewReservationRequestDto request ) {
@@ -140,5 +146,4 @@ public ResponseEntity<List<InterviewSlotResponseDto>> getAllInterviewSlots() {
140146 List <InterviewSlotResponseDto > allSlots = interviewService .getAllInterviewSlots ();
141147 return ResponseEntity .ok (allSlots );
142148 }
143-
144149}
0 commit comments