-
Notifications
You must be signed in to change notification settings - Fork 70
/
ConsultantServiceImpl.java
43 lines (32 loc) · 1.06 KB
/
ConsultantServiceImpl.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package com.levent.consultantapi.service.consultant.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.levent.consultantapi.model.Consultant;
import com.levent.consultantapi.repository.ConsultantRepository;
import com.levent.consultantapi.service.ConsultantService;
@Service
public class ConsultantServiceImpl implements ConsultantService {
@Autowired
private ConsultantRepository consultantRepository;
@Override
public List<Consultant> getConsultants() {
return consultantRepository.list();
}
@Override
public Consultant createConsultant(Consultant consultant) {
return consultantRepository.create(consultant);
}
@Override
public Consultant getConsultantById(Long id) {
return consultantRepository.get(id);
}
@Override
public Consultant updateConsultantById(Long id, Consultant consultant) {
return consultantRepository.update(id, consultant);
}
@Override
public Consultant deleteConsultantById(Long id) {
return consultantRepository.delete(id);
}
}