main
Last change
on this file since a762b3a was a762b3a, checked in by SazdovaEkaterina <sazdovaekaterina@…>, 17 months ago |
adoption posts list + pet details page
|
-
Property mode
set to
100644
|
File size:
815 bytes
|
Rev | Line | |
---|
[55c0119] | 1 | package finki.paw5.service.implementation;
|
---|
| 2 |
|
---|
[468b7b6] | 3 | import finki.paw5.model.entities.Pet;
|
---|
[988f3fa] | 4 | import finki.paw5.repository.PetRepository;
|
---|
[55c0119] | 5 | import finki.paw5.service.PetService;
|
---|
| 6 | import org.springframework.stereotype.Service;
|
---|
| 7 |
|
---|
[a762b3a] | 8 | import java.util.List;
|
---|
| 9 | import java.util.Optional;
|
---|
| 10 |
|
---|
[55c0119] | 11 | @Service
|
---|
| 12 | public class PetServiceImplementation implements PetService {
|
---|
[988f3fa] | 13 |
|
---|
| 14 | private final PetRepository petRepository;
|
---|
| 15 |
|
---|
| 16 | public PetServiceImplementation(PetRepository petRepository) {
|
---|
| 17 | this.petRepository = petRepository;
|
---|
| 18 | }
|
---|
| 19 |
|
---|
[468b7b6] | 20 | @Override
|
---|
| 21 | public void save(Pet pet) {
|
---|
| 22 | this.petRepository.save(pet);
|
---|
| 23 | }
|
---|
[a762b3a] | 24 |
|
---|
| 25 | @Override
|
---|
| 26 | public List<Pet> findAll() {
|
---|
| 27 | return this.petRepository.findAll();
|
---|
| 28 | }
|
---|
| 29 |
|
---|
| 30 | @Override
|
---|
| 31 | public Optional<Pet> findById(Integer petId) {
|
---|
| 32 | return this.petRepository.findById(petId);
|
---|
| 33 | }
|
---|
[988f3fa] | 34 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.