-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathFindLabelController.java
More file actions
40 lines (35 loc) · 1.7 KB
/
FindLabelController.java
File metadata and controls
40 lines (35 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package clap.server.adapter.inbound.web.label;
import clap.server.adapter.inbound.security.SecurityUserDetails;
import clap.server.adapter.inbound.web.dto.common.SliceResponse;
import clap.server.adapter.inbound.web.dto.label.FindLabelListResponse;
import clap.server.application.port.inbound.label.FindLabelListUsecase;
import clap.server.common.annotation.architecture.WebAdapter;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.annotation.Secured;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Tag(name = "02. Task [조회]", description = "담당자 및 관리자 공통으로 사용")
@WebAdapter
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/labels")
public class FindLabelController {
private final FindLabelListUsecase findLabelListUsecase;
@Operation(summary = "구분 목록 조회 API")
@Secured({"ROLE_MANAGER", "ROLE_ADMIN"})
@GetMapping
public ResponseEntity<List<FindLabelListResponse>> findLabelList(
@AuthenticationPrincipal SecurityUserDetails userInfo) {
return ResponseEntity.ok(findLabelListUsecase.findLabelList(userInfo.getUserId()));
}
}