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