| Total Complexity | 3 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | package com.osomapps.pt.reportphoto; |
||
| 12 | @RestController |
||
| 13 | @RequestMapping("api/v1/report-photo") |
||
| 14 | class ReportPhotoResource { |
||
| 15 | |||
| 16 | private final ReportPhotoService reportPhotoService; |
||
| 17 | |||
| 18 | @Autowired |
||
| 19 | ReportPhotoResource(ReportPhotoService reportPhotoService) { |
||
| 20 | this.reportPhotoService = reportPhotoService; |
||
| 21 | } |
||
| 22 | |||
| 23 | @GetMapping |
||
| 24 | List<PhotoResponseDTO> findAll(@RequestHeader(value = "X-Token") String token) { |
||
| 25 | return reportPhotoService.findAll(token); |
||
| 26 | } |
||
| 27 | |||
| 28 | @PostMapping |
||
| 29 | PhotoResponseDTO create( |
||
| 30 | @RequestHeader(value = "X-Token") String token, |
||
| 31 | @RequestBody PhotoRequestDTO weightRequestDTO) { |
||
| 32 | return reportPhotoService.create(token, weightRequestDTO); |
||
| 33 | } |
||
| 35 |