Skip to content

Commit 253926f

Browse files
committed
feat: 어드민; 지원자 조회 엔드포인트 구현
1 parent ae23137 commit 253926f

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package dmu.dasom.api.global.admin.controller;
2+
3+
import dmu.dasom.api.domain.applicant.dto.ApplicantResponseDto;
4+
import dmu.dasom.api.domain.applicant.service.ApplicantService;
5+
import dmu.dasom.api.global.dto.PageResponse;
6+
import io.swagger.v3.oas.annotations.Operation;
7+
import io.swagger.v3.oas.annotations.media.Content;
8+
import io.swagger.v3.oas.annotations.media.ExampleObject;
9+
import io.swagger.v3.oas.annotations.media.Schema;
10+
import io.swagger.v3.oas.annotations.responses.ApiResponse;
11+
import io.swagger.v3.oas.annotations.responses.ApiResponses;
12+
import jakarta.validation.constraints.Min;
13+
import lombok.RequiredArgsConstructor;
14+
import org.springframework.http.ResponseEntity;
15+
import org.springframework.web.ErrorResponse;
16+
import org.springframework.web.bind.annotation.GetMapping;
17+
import org.springframework.web.bind.annotation.RequestMapping;
18+
import org.springframework.web.bind.annotation.RequestParam;
19+
import org.springframework.web.bind.annotation.RestController;
20+
21+
@RestController
22+
@RequestMapping("/api/admin")
23+
@RequiredArgsConstructor
24+
public class AdminController {
25+
26+
private final ApplicantService applicantService;
27+
28+
// 지원자 조회
29+
@Operation(summary = "지원자 조회")
30+
@ApiResponses(value = {
31+
@ApiResponse(responseCode = "200", description = "지원자 조회 성공"),
32+
@ApiResponse(responseCode = "400", description = "잘못된 요청",
33+
content = @Content(
34+
mediaType = "application/json",
35+
schema = @Schema(implementation = ErrorResponse.class),
36+
examples = {
37+
@ExampleObject(
38+
name = "조회 결과 없음",
39+
value = "{ \"code\": \"C011\", \"message\": \"조회 결과가 없습니다.\" }"
40+
)
41+
}
42+
)
43+
)
44+
})
45+
@GetMapping("/applicants")
46+
public ResponseEntity<PageResponse<ApplicantResponseDto>> getApplicants(
47+
@RequestParam(value = "page", defaultValue = "0") @Min(0) final int page
48+
) {
49+
return ResponseEntity.ok(applicantService.getApplicants(page));
50+
}
51+
52+
}

0 commit comments

Comments
 (0)