| Total Complexity | 3 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | package com.osomapps.pt.activecertificate; |
||
| 11 | @RestController |
||
| 12 | @RequestMapping("api/v1/active-certificate") |
||
| 13 | class ActiveCertificateResource { |
||
| 14 | |||
| 15 | private final ActiveCertificateService certificateService; |
||
| 16 | |||
| 17 | @Autowired |
||
| 18 | ActiveCertificateResource(ActiveCertificateService certificateService) { |
||
| 19 | this.certificateService = certificateService; |
||
| 20 | } |
||
| 21 | |||
| 22 | @GetMapping |
||
| 23 | ActiveCertificateResponseDTO firstActive(@RequestHeader(value = "X-Token") String token) { |
||
| 24 | return certificateService.firstActive(token); |
||
| 25 | } |
||
| 26 | |||
| 27 | @PostMapping |
||
| 28 | ActiveCertificateResponseDTO create( |
||
| 29 | @RequestHeader(value = "X-Token") String token, |
||
| 30 | @RequestBody ActiveCertificateRequestDTO certificateRequestDTO) { |
||
| 31 | return certificateService.create(token, certificateRequestDTO); |
||
| 32 | } |
||
| 34 |