Changeset 2a5d6a3 in Git for src/main/java/com/wediscussmovies/project/service
- Timestamp:
- 01/16/22 15:29:49 (3 years ago)
- Branches:
- main
- Children:
- 7bc8942
- Parents:
- 7a0bf79
- Location:
- src/main/java/com/wediscussmovies/project/service
- Files:
-
- 3 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/wediscussmovies/project/service/DiscussionService.java
r7a0bf79 r2a5d6a3 1 1 package com.wediscussmovies.project.service; 2 2 3 import com.wediscussmovies.project.model.Discussion; 4 5 import java.util.List; 6 import java.util.Optional; 7 3 8 public interface DiscussionService { 9 List<Discussion> listAll(); 10 List<Discussion> listAllByTitle(String title); 11 Optional<Discussion> findById(Integer id); 12 void save(Discussion discussion); 4 13 } -
src/main/java/com/wediscussmovies/project/service/PersonService.java
r7a0bf79 r2a5d6a3 9 9 public List<Person> findAllDirectors(); 10 10 public List<Person> findAllActors(); 11 Optional<Person> findById(Integer person_id); 11 12 Optional<Person> findActorById(Integer id); 12 13 Optional<Person> findDirectorById(Integer id); 14 boolean save(Person person); 15 List<Person> findActorsByNameLike(String name); 16 List<Person> findActorsBySurnameLike(String surname); 17 List<Person> findDirectorsByNameLike(String name); 18 List<Person> findDirectorsBySurnameLike(String surname); 19 13 20 } -
src/main/java/com/wediscussmovies/project/service/ReplyService.java
r7a0bf79 r2a5d6a3 1 1 package com.wediscussmovies.project.service; 2 2 3 import com.wediscussmovies.project.model.Reply; 4 5 import java.util.Optional; 6 3 7 public interface ReplyService { 8 public Reply save(Reply r); 9 public void delete(Reply r); 10 Optional<Reply> findById(Integer id); 4 11 } -
src/main/java/com/wediscussmovies/project/service/UserService.java
r7a0bf79 r2a5d6a3 1 1 package com.wediscussmovies.project.service; 2 2 3 import com.wediscussmovies.project.model.User; 4 5 import javax.servlet.http.HttpServletRequest; 6 import java.util.Optional; 7 3 8 public interface UserService { 9 public Optional<User> login(String email, String password); 10 public Optional<User> register(HttpServletRequest request, String email, String password, String confirmPassword, String username, String name, String surname); 4 11 } -
src/main/java/com/wediscussmovies/project/service/impl/PersonServiceImpl.java
r7a0bf79 r2a5d6a3 28 28 } 29 29 30 @Override 31 public Optional<Person> findById(Integer person_id) { 32 return personRepository.findById(person_id); 33 } 30 34 31 35 @Override … … 38 42 return personRepository.findAllByPersonType(PersonType.A); 39 43 } 44 45 @Override 46 public boolean save(Person person) { 47 Person p = personRepository.save(person); 48 if(p != null) 49 return true; 50 return false; 51 } 52 53 @Override 54 public List<Person> findActorsByNameLike(String name) { 55 return personRepository.findAllByPersonTypeAndNameLike(PersonType.A, name); 56 } 57 58 @Override 59 public List<Person> findActorsBySurnameLike(String surname) { 60 return personRepository.findAllByPersonTypeAndSurnameLike(PersonType.A, surname); 61 } 62 63 @Override 64 public List<Person> findDirectorsByNameLike(String name) { 65 return personRepository.findAllByPersonTypeAndNameLike(PersonType.D, name); 66 } 67 68 @Override 69 public List<Person> findDirectorsBySurnameLike(String surname) { 70 return personRepository.findAllByPersonTypeAndSurnameLike(PersonType.D, surname); 71 } 40 72 }
Note:
See TracChangeset
for help on using the changeset viewer.