-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCertificateAdminControllerImpl.java
More file actions
25 lines (22 loc) · 1.08 KB
/
CertificateAdminControllerImpl.java
File metadata and controls
25 lines (22 loc) · 1.08 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
package kgu.developers.admin.certificate.presentation;
import kgu.developers.admin.certificate.application.CertificateAdminFacade;
import kgu.developers.admin.certificate.presentation.response.CertificateDetailResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/api/v1/admin/certificate")
@RequiredArgsConstructor
@PreAuthorize("hasRole('ROLE_ADMIN')")
public class CertificateAdminControllerImpl implements CertificateAdminController {
private final CertificateAdminFacade certificateAdminFacade;
@Override
@GetMapping("/{id}")
public ResponseEntity<CertificateDetailResponse> getCertificate(@PathVariable Long id) {
return ResponseEntity.ok(certificateAdminFacade.getById(id));
}
}