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 | |
---|
1 | package mk.ukim.finki.busngo.service.impl;
|
---|
2 |
|
---|
3 | import mk.ukim.finki.busngo.model.entities.Linija;
|
---|
4 | import mk.ukim.finki.busngo.model.exceptions.InvalidLinijaIdException;
|
---|
5 | import mk.ukim.finki.busngo.repository.LinijaRepository;
|
---|
6 | import mk.ukim.finki.busngo.service.LinijaService;
|
---|
7 | import org.springframework.stereotype.Service;
|
---|
8 |
|
---|
9 | import java.util.List;
|
---|
10 |
|
---|
11 | @Service
|
---|
12 | public 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.