Ignore:
Timestamp:
01/16/22 20:22:55 (3 years ago)
Author:
Test <matonikolov77@…>
Branches:
main
Children:
3ded84d
Parents:
2d57cad (diff), 7bc8942 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Resolving models

Location:
src/main/java/com/wediscussmovies/project/service
Files:
5 added
7 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/com/wediscussmovies/project/service/DiscussionService.java

    r2d57cad r7fafead  
    11package com.wediscussmovies.project.service;
    22
     3import com.wediscussmovies.project.model.Discussion;
     4
     5import java.util.List;
     6import java.util.Optional;
     7
    38public interface DiscussionService {
     9    List<Discussion> listAll();
     10    List<Discussion> listAllByTitle(String title);
     11    Optional<Discussion> findById(Integer id);
     12    void save(Discussion discussion);
    413}
  • src/main/java/com/wediscussmovies/project/service/GenreService.java

    r2d57cad r7fafead  
    11package com.wediscussmovies.project.service;
    22
     3import com.wediscussmovies.project.model.Genre;
     4import org.springframework.stereotype.Service;
     5
     6import java.util.List;
     7import java.util.Optional;
     8
     9@Service
    310public interface GenreService {
     11    public List<Genre> findAll();
     12    public Optional<Genre> findById(Integer id);
     13    public List<Genre> findAllByType(String genre);
     14    public Genre save(String genreName);
    415}
  • src/main/java/com/wediscussmovies/project/service/MovieService.java

    r2d57cad r7fafead  
    44
    55import java.util.List;
     6import java.util.Optional;
    67
    78public interface MovieService {
    89    public List<Movie> listAll();
    910    public List<Movie> searchByTitle(String title);
     11    public Optional<Movie> findById(Long id);
     12    public Movie save(Movie movie);
     13    public void deleteById(Long id);
    1014}
  • src/main/java/com/wediscussmovies/project/service/PersonService.java

    r2d57cad r7fafead  
    11package com.wediscussmovies.project.service;
    22
     3import com.wediscussmovies.project.model.Person;
     4
     5import java.util.List;
     6import java.util.Optional;
     7
    38public interface PersonService {
     9     List<Person> findAllDirectors();
     10     List<Person> findAllActors();
     11    Optional<Person> findById(Integer person_id);
     12    Optional<Person> findActorById(Integer id);
     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
    420}
  • src/main/java/com/wediscussmovies/project/service/ReplyService.java

    r2d57cad r7fafead  
    11package com.wediscussmovies.project.service;
    22
     3import com.wediscussmovies.project.model.Reply;
     4
     5import java.util.Optional;
     6
    37public interface ReplyService {
     8    public Reply save(Reply r);
     9    public void delete(Reply r);
     10    Optional<Reply> findById(Long id);
     11
    412}
  • src/main/java/com/wediscussmovies/project/service/UserService.java

    r2d57cad r7fafead  
    11package com.wediscussmovies.project.service;
    22
     3import com.wediscussmovies.project.model.User;
     4
     5import javax.servlet.http.HttpServletRequest;
     6import java.util.Optional;
     7
    38public 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);
    411}
  • src/main/java/com/wediscussmovies/project/service/impl/MovieServiceImpl.java

    r2d57cad r7fafead  
    77
    88import java.util.List;
     9import java.util.Optional;
    910
    1011@Service
     
    2223
    2324    @Override
     25    public Optional<Movie> findById(Long id) {
     26        return movieRepository.findById(1);
     27    }
     28
     29    @Override
     30    public Movie save(Movie movie) {
     31        return movieRepository.save(movie);
     32    }
     33
     34    @Override
     35    public void deleteById(Long id) {
     36        movieRepository.deleteById(0);
     37    }
     38
     39    @Override
    2440    public List<Movie> searchByTitle(String title) {
    2541        return movieRepository.findAllByTitleLike("%"+title+"%");
    2642    }
    2743}
     44
     45
Note: See TracChangeset for help on using the changeset viewer.