Revize 49a56af1
Přidáno uživatelem Dominik Poch před téměř 6 roky(ů)
server/src/main/java/cz/zcu/yamanager/business/ApiManager.java | ||
---|---|---|
6 | 6 |
import cz.zcu.yamanager.repository.VacationRepository; |
7 | 7 |
import cz.zcu.yamanager.ws.rest.RESTFullException; |
8 | 8 |
import org.apache.tomcat.jni.Local; |
9 |
import org.springframework.beans.factory.annotation.Autowired; |
|
9 | 10 |
import org.springframework.jdbc.core.JdbcTemplate; |
11 |
import org.springframework.stereotype.Component; |
|
10 | 12 |
|
11 | 13 |
import java.time.LocalDate; |
12 | 14 |
import java.util.List; |
13 | 15 |
|
16 |
@Component |
|
14 | 17 |
public class ApiManager implements Manager { |
15 | 18 |
|
16 | 19 |
private static final int DAYS_IN_WEEK = 7; |
... | ... | |
19 | 22 |
private UserRepository userRepository; |
20 | 23 |
private VacationRepository vacationRepository; |
21 | 24 |
|
22 |
public ApiManager(JdbcTemplate jdbc) { |
|
23 |
this.requestRepository = new RequestRepository(jdbc); |
|
24 |
this.userRepository = new UserRepository(jdbc); |
|
25 |
this.vacationRepository = new VacationRepository(jdbc); |
|
25 |
@Autowired |
|
26 |
public ApiManager(RequestRepository requestRepository, UserRepository userRepository, VacationRepository vacationRepository) { |
|
27 |
this.requestRepository = requestRepository; |
|
28 |
this.userRepository = userRepository; |
|
29 |
this.vacationRepository = vacationRepository; |
|
26 | 30 |
} |
27 | 31 |
|
28 | 32 |
@Override |
server/src/main/java/cz/zcu/yamanager/business/mock/ManagerMock.java | ||
---|---|---|
15 | 15 |
|
16 | 16 |
import static java.util.Arrays.asList; |
17 | 17 |
|
18 |
@Component |
|
19 | 18 |
public class ManagerMock implements Manager { |
20 | 19 |
|
21 | 20 |
private List<DefaultSettings> settings = new LinkedList<>(); |
Také k dispozici: Unified diff
Re #7551 Api manager, autowired