Skip to content

Commit f7b8d10

Browse files
committed
CLAP-165 Feat: 검토자용 구분 목록 조회 API 구현
1 parent 6c665b9 commit f7b8d10

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package clap.server.adapter.inbound.web.label;
2+
3+
import clap.server.adapter.inbound.security.SecurityUserDetails;
4+
import clap.server.adapter.inbound.web.dto.common.SliceResponse;
5+
import clap.server.adapter.inbound.web.dto.label.FindLabelListResponse;
6+
import clap.server.application.port.inbound.label.FindLabelListUsecase;
7+
import clap.server.common.annotation.architecture.WebAdapter;
8+
import io.swagger.v3.oas.annotations.Operation;
9+
import io.swagger.v3.oas.annotations.Parameter;
10+
import io.swagger.v3.oas.annotations.Parameters;
11+
import io.swagger.v3.oas.annotations.tags.Tag;
12+
import lombok.RequiredArgsConstructor;
13+
import org.springframework.data.domain.PageRequest;
14+
import org.springframework.data.domain.Pageable;
15+
import org.springframework.http.ResponseEntity;
16+
import org.springframework.security.access.annotation.Secured;
17+
import org.springframework.security.core.annotation.AuthenticationPrincipal;
18+
import org.springframework.web.bind.annotation.GetMapping;
19+
import org.springframework.web.bind.annotation.RequestMapping;
20+
import org.springframework.web.bind.annotation.RequestParam;
21+
import org.springframework.web.bind.annotation.RestController;
22+
23+
import java.util.List;
24+
25+
@Tag(name = "02. Task[검토자]")
26+
@WebAdapter
27+
@RestController
28+
@RequiredArgsConstructor
29+
@RequestMapping("/api/labels")
30+
public class FindLabelController {
31+
32+
private final FindLabelListUsecase findLabelListUsecase;
33+
34+
@Operation(summary = "구분 목록 조회 API")
35+
@Parameters({
36+
@Parameter(name = "page", description = "조회할 목록 페이지 번호(0부터 시작)", example = "0", required = false),
37+
@Parameter(name = "size", description = "조회할 목록 페이지 당 개수", example = "5", required = false)
38+
})
39+
@Secured({"ROLE_MANAGER"})
40+
@GetMapping
41+
public ResponseEntity<SliceResponse<FindLabelListResponse>> findLabelList(
42+
@AuthenticationPrincipal SecurityUserDetails userInfo,
43+
@RequestParam(defaultValue = "0") int page,
44+
@RequestParam(defaultValue = "5") int size) {
45+
Pageable pageable = PageRequest.of(page, size);
46+
return ResponseEntity.ok(findLabelListUsecase.findLabelList(userInfo.getUserId(), pageable));
47+
}
48+
}

0 commit comments

Comments
 (0)