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:
912 bytes
|
Line | |
---|
1 | package mk.ukim.finki.busngo.service.impl;
|
---|
2 |
|
---|
3 | import mk.ukim.finki.busngo.model.entities.Avtobus;
|
---|
4 | import mk.ukim.finki.busngo.model.exceptions.InvalidAvtobusRegistracijaException;
|
---|
5 | import mk.ukim.finki.busngo.repository.AvtobusRepository;
|
---|
6 | import mk.ukim.finki.busngo.service.AvtobusService;
|
---|
7 | import org.springframework.stereotype.Service;
|
---|
8 |
|
---|
9 | import java.util.List;
|
---|
10 |
|
---|
11 | @Service
|
---|
12 | public class AvtobusServiceImpl implements AvtobusService {
|
---|
13 | private final AvtobusRepository avtobusRepository;
|
---|
14 |
|
---|
15 | public AvtobusServiceImpl(AvtobusRepository avtobusRepository) {
|
---|
16 | this.avtobusRepository = avtobusRepository;
|
---|
17 | }
|
---|
18 |
|
---|
19 | @Override
|
---|
20 | public List<Avtobus> findAll() {
|
---|
21 | return avtobusRepository.findAll();
|
---|
22 | }
|
---|
23 |
|
---|
24 | @Override
|
---|
25 | public Avtobus findById(String aRegistracija) {
|
---|
26 | return avtobusRepository.findByARegistracija(aRegistracija).orElseThrow(InvalidAvtobusRegistracijaException::new);
|
---|
27 | }
|
---|
28 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.