source: bus-n-go-do-5ta-faza/src/main/java/mk/ukim/finki/busngo/service/impl/LinijaServiceImpl.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: 844 bytes
Line 
1package mk.ukim.finki.busngo.service.impl;
2
3import mk.ukim.finki.busngo.model.entities.Linija;
4import mk.ukim.finki.busngo.model.exceptions.InvalidLinijaIdException;
5import mk.ukim.finki.busngo.repository.LinijaRepository;
6import mk.ukim.finki.busngo.service.LinijaService;
7import org.springframework.stereotype.Service;
8
9import java.util.List;
10
11@Service
12public class LinijaServiceImpl implements LinijaService {
13
14 private final LinijaRepository linijaRepository;
15
16 public LinijaServiceImpl(LinijaRepository linijaRepository) {
17 this.linijaRepository = linijaRepository;
18 }
19
20 @Override
21 public List<Linija> findAll() {
22 return linijaRepository.findAll();
23 }
24
25 @Override
26 public Linija findById(Long liId) {
27 return linijaRepository.findById(liId).orElseThrow(InvalidLinijaIdException::new);
28 }
29}
Note: See TracBrowser for help on using the repository browser.