-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathUpdateLabelController.java
More file actions
31 lines (27 loc) · 1.25 KB
/
UpdateLabelController.java
File metadata and controls
31 lines (27 loc) · 1.25 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
package clap.server.adapter.inbound.web.admin;
import clap.server.adapter.inbound.security.SecurityUserDetails;
import clap.server.adapter.inbound.web.dto.label.AddLabelRequest;
import clap.server.application.port.inbound.admin.AddLabelUsecase;
import clap.server.common.annotation.architecture.WebAdapter;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.annotation.Secured;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@Tag(name = "05. Admin")
@WebAdapter
@RequiredArgsConstructor
@RequestMapping("/api/management/label")
public class UpdateLabelController {
private final AddLabelUsecase addLabelUsecase;
@Operation(summary = "구분(label) 추가 API")
@PostMapping
@Secured({"ROLE_ADMIN"})
public void addLabel(@AuthenticationPrincipal SecurityUserDetails userInfo,
@RequestBody AddLabelRequest request) {
addLabelUsecase.addLabel(userInfo.getUserId(), request);
}
}