source: bus-n-go-do-5ta-faza/src/main/java/mk/ukim/finki/busngo/service/impl/KondukterServiceImpl.java

Last change on this file was baf4cc4, checked in by ppaunovski <paunovskipavel@…>, 3 months ago

split group project and individual project into two separate folders

  • Property mode set to 100644
File size: 880 bytes
Line 
1package mk.ukim.finki.busngo.service.impl;
2
3import mk.ukim.finki.busngo.model.entities.Kondukter;
4import mk.ukim.finki.busngo.model.exceptions.InvalidUserId;
5import mk.ukim.finki.busngo.repository.KondukterRepository;
6import mk.ukim.finki.busngo.service.KondukterService;
7import org.springframework.stereotype.Service;
8
9import java.util.List;
10
11@Service
12public class KondukterServiceImpl implements KondukterService {
13 private final KondukterRepository kondukterRepository;
14
15 public KondukterServiceImpl(KondukterRepository kondukterRepository) {
16 this.kondukterRepository = kondukterRepository;
17 }
18
19 @Override
20 public List<Kondukter> findAll() {
21 return kondukterRepository.findAll();
22 }
23
24 @Override
25 public Kondukter findByEmail(String email) {
26 return kondukterRepository.findByKEmail(email).orElseThrow(InvalidUserId::new);
27 }
28}
Note: See TracBrowser for help on using the repository browser.