Ignore:
Timestamp:
02/14/23 20:45:37 (17 months ago)
Author:
SazdovaEkaterina <sazdovaekaterina@…>
Branches:
main
Children:
59a8941
Parents:
3f5e485
Message:

adoption posts list + pet details page

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  
    22
    33import finki.paw5.model.entities.Pet;
     4import finki.paw5.web.controllers.PostController;
     5
     6import java.util.List;
     7import java.util.Optional;
    48
    59public interface PetService {
    610
    711    void save (Pet pet);
     12
     13    List<Pet> findAll();
     14
     15    Optional<Pet> findById(Integer petId);
    816}
  • Prototype Application/Paw5/src/main/java/finki/paw5/service/PostService.java

    r3f5e485 ra762b3a  
    22
    33import 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
     5import java.util.List;
     6import java.util.Optional;
    87
    98public interface PostService {
     
    1110    void save (Post post);
    1211
     12    List<Post> findAll();
     13
     14    Optional<Post> findById(Integer id);
    1315}
  • Prototype Application/Paw5/src/main/java/finki/paw5/service/implementation/PetServiceImplementation.java

    r3f5e485 ra762b3a  
    55import finki.paw5.service.PetService;
    66import org.springframework.stereotype.Service;
     7
     8import java.util.List;
     9import java.util.Optional;
    710
    811@Service
     
    1922        this.petRepository.save(pet);
    2023    }
     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    }
    2134}
  • Prototype Application/Paw5/src/main/java/finki/paw5/service/implementation/PostServiceImplementation.java

    r3f5e485 ra762b3a  
    55import finki.paw5.service.PostService;
    66import org.springframework.stereotype.Service;
     7
     8import java.util.List;
     9import java.util.Optional;
    710
    811@Service
     
    2023    }
    2124
     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    }
    2234}
Note: See TracChangeset for help on using the changeset viewer.