com.osomapps.pt.programs.ProgramsResource   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 9
dl 0
loc 14
c 0
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A ProgramsResource(ProgramService) 0 3 1
A findAll(String) 0 3 1
1
package com.osomapps.pt.programs;
2
3
import java.util.List;
4
import org.springframework.beans.factory.annotation.Autowired;
5
import org.springframework.web.bind.annotation.GetMapping;
6
import org.springframework.web.bind.annotation.RequestHeader;
7
import org.springframework.web.bind.annotation.RequestMapping;
8
import org.springframework.web.bind.annotation.RestController;
9
10
@RestController
11
@RequestMapping("api/v1/programs")
12
class ProgramsResource {
13
14
    private final ProgramService programService;
15
16
    @Autowired
17
    ProgramsResource(ProgramService programService) {
18
        this.programService = programService;
19
    }
20
21
    @GetMapping
22
    List<ProgramResponseDTO> findAll(@RequestHeader(value = "X-Token") String token) {
23
        return programService.getExamples(token);
24
    }
25
}
26