- Timestamp:
- 02/14/23 20:45:37 (17 months ago)
- Branches:
- main
- Children:
- 59a8941
- Parents:
- 3f5e485
- Location:
- Prototype Application/Paw5/src/main/java/finki/paw5/service
- Files:
-
- 4 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
Prototype Application/Paw5/src/main/java/finki/paw5/service/PetService.java
r3f5e485 ra762b3a 2 2 3 3 import finki.paw5.model.entities.Pet; 4 import finki.paw5.web.controllers.PostController; 5 6 import java.util.List; 7 import java.util.Optional; 4 8 5 9 public interface PetService { 6 10 7 11 void save (Pet pet); 12 13 List<Pet> findAll(); 14 15 Optional<Pet> findById(Integer petId); 8 16 } -
Prototype Application/Paw5/src/main/java/finki/paw5/service/PostService.java
r3f5e485 ra762b3a 2 2 3 3 import finki.paw5.model.entities.Post; 4 import finki.paw5.model.enumerations.AgeGroup; 5 import finki.paw5.model.enumerations.Gender; 6 import finki.paw5.model.enumerations.Size; 7 import finki.paw5.model.enumerations.Species; 4 5 import java.util.List; 6 import java.util.Optional; 8 7 9 8 public interface PostService { … … 11 10 void save (Post post); 12 11 12 List<Post> findAll(); 13 14 Optional<Post> findById(Integer id); 13 15 } -
Prototype Application/Paw5/src/main/java/finki/paw5/service/implementation/PetServiceImplementation.java
r3f5e485 ra762b3a 5 5 import finki.paw5.service.PetService; 6 6 import org.springframework.stereotype.Service; 7 8 import java.util.List; 9 import java.util.Optional; 7 10 8 11 @Service … … 19 22 this.petRepository.save(pet); 20 23 } 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 } 21 34 } -
Prototype Application/Paw5/src/main/java/finki/paw5/service/implementation/PostServiceImplementation.java
r3f5e485 ra762b3a 5 5 import finki.paw5.service.PostService; 6 6 import org.springframework.stereotype.Service; 7 8 import java.util.List; 9 import java.util.Optional; 7 10 8 11 @Service … … 20 23 } 21 24 25 @Override 26 public List<Post> findAll() { 27 return this.postRepository.findAll(); 28 } 29 30 @Override 31 public Optional<Post> findById(Integer id) { 32 return this.postRepository.findById(id); 33 } 22 34 }
Note:
See TracChangeset
for help on using the changeset viewer.