Ignore:
Timestamp:
02/09/22 15:46:58 (3 years ago)
Author:
Test <matonikolov77@…>
Branches:
main
Children:
8f1b7e9
Parents:
967b414
Message:

Refactored reply repository and discussion repository

Location:
src/main/java/com/wediscussmovies/project/service/impl
Files:
2 edited

Legend:

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

    r967b414 r6f91f99  
    77import com.wediscussmovies.project.model.primarykeys.DiscussionLikesPK;
    88import com.wediscussmovies.project.model.relation.DiscussionLikes;
     9import com.wediscussmovies.project.querymodels.DiscussionLikesQM;
    910import com.wediscussmovies.project.repository.*;
    1011import com.wediscussmovies.project.model.Discussion;
     
    115116
    116117    @Override
    117     public com.wediscussmovies.project.querymodels.DiscussionLikes findLikesForDiscussionWithId(int discussionId) {
    118         return discussionRepository.findAllWithLikes().stream().filter(d ->  d.getDiscussionId().equals(discussionId)).findFirst().get();
     118    public DiscussionLikesQM findLikesForDiscussionWithId(Integer discussionId) {
     119//        return discussionRepository.findAllWithLikes().stream().filter(d ->  d.getDiscussionId().equals(discussionId)).findFirst().get();
     120                return this.discussionRepository.findDiscussionWithLikes(discussionId);
     121
     122    }
     123
     124    @Override
     125    public void findLikesForAllDiscussions(List<Discussion> discussions) {
     126//        this.discussionRepository.findAllDiscussionsWithLikes()
     127//                .forEach(el ->{
     128//                        if (discussions.)
     129//                });
    119130    }
    120131
  • src/main/java/com/wediscussmovies/project/service/impl/GenreServiceImpl.java

    r967b414 r6f91f99  
    44import com.wediscussmovies.project.model.exception.GenreNotExistException;
    55import com.wediscussmovies.project.model.exception.UserNotExistException;
    6 import com.wediscussmovies.project.model.primarykeys.GenreLikesPK;
    76import com.wediscussmovies.project.model.primarykeys.UserGenresPK;
    8 import com.wediscussmovies.project.model.relation.MovieLikes;
    97import com.wediscussmovies.project.model.relation.UserGenres;
    10 import com.wediscussmovies.project.querymodels.GenreLikes;
     8import com.wediscussmovies.project.querymodels.GenreLikesQM;
    119import com.wediscussmovies.project.repository.GenreLikesRepository;
    1210import com.wediscussmovies.project.repository.GenreRepository;
     
    4846
    4947    @Override
    50     public List<GenreLikes> findAllWithLikes() {
    51         List<GenreLikes> genreLikesList = this.genreRepository.findAllWithLikes();
    52         genreLikesList.sort(GenreLikes.sorter);
    53         return genreLikesList;
     48    public List<GenreLikesQM> findAllWithLikes() {
     49        // List<GenreLikes> genreLikesList = this.genreRepository.findAllWithLikes();
     50       // genreLikesList.sort(GenreLikes.sorter);
     51        return this.genreRepository.findAllWithLikes();
    5452    }
    5553
Note: See TracChangeset for help on using the changeset viewer.