Changeset 6f91f99 in Git for src/main/java/com/wediscussmovies/project/service
- Timestamp:
- 02/09/22 15:46:58 (3 years ago)
- Branches:
- main
- Children:
- 8f1b7e9
- Parents:
- 967b414
- Location:
- src/main/java/com/wediscussmovies/project/service
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/wediscussmovies/project/service/DiscussionService.java
r967b414 r6f91f99 3 3 import com.wediscussmovies.project.model.Discussion; 4 4 import com.wediscussmovies.project.model.User; 5 import com.wediscussmovies.project.querymodels.DiscussionLikes ;5 import com.wediscussmovies.project.querymodels.DiscussionLikesQM; 6 6 7 7 import java.util.List; … … 20 20 List<Discussion> findLikedDiscussionsByUser(User user); 21 21 22 DiscussionLikes findLikesForDiscussionWithId(int discussionId); 22 DiscussionLikesQM findLikesForDiscussionWithId(Integer discussionId); 23 24 void findLikesForAllDiscussions(List<Discussion> discussions); 23 25 24 26 } -
src/main/java/com/wediscussmovies/project/service/GenreService.java
r967b414 r6f91f99 2 2 3 3 import com.wediscussmovies.project.model.Genre; 4 import com.wediscussmovies.project.querymodels.GenreLikes ;4 import com.wediscussmovies.project.querymodels.GenreLikesQM; 5 5 import org.springframework.stereotype.Service; 6 6 … … 13 13 List<Genre> findAllByType(String genre); 14 14 Genre save(String genreName); 15 List<GenreLikes > findAllWithLikes();15 List<GenreLikesQM> findAllWithLikes(); 16 16 void likeGenre(Integer genreId,Integer userId); 17 17 void unlikeGenre(Integer genreId,Integer userId); -
src/main/java/com/wediscussmovies/project/service/impl/DiscussionServiceImpl.java
r967b414 r6f91f99 7 7 import com.wediscussmovies.project.model.primarykeys.DiscussionLikesPK; 8 8 import com.wediscussmovies.project.model.relation.DiscussionLikes; 9 import com.wediscussmovies.project.querymodels.DiscussionLikesQM; 9 10 import com.wediscussmovies.project.repository.*; 10 11 import com.wediscussmovies.project.model.Discussion; … … 115 116 116 117 @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 // }); 119 130 } 120 131 -
src/main/java/com/wediscussmovies/project/service/impl/GenreServiceImpl.java
r967b414 r6f91f99 4 4 import com.wediscussmovies.project.model.exception.GenreNotExistException; 5 5 import com.wediscussmovies.project.model.exception.UserNotExistException; 6 import com.wediscussmovies.project.model.primarykeys.GenreLikesPK;7 6 import com.wediscussmovies.project.model.primarykeys.UserGenresPK; 8 import com.wediscussmovies.project.model.relation.MovieLikes;9 7 import com.wediscussmovies.project.model.relation.UserGenres; 10 import com.wediscussmovies.project.querymodels.GenreLikes ;8 import com.wediscussmovies.project.querymodels.GenreLikesQM; 11 9 import com.wediscussmovies.project.repository.GenreLikesRepository; 12 10 import com.wediscussmovies.project.repository.GenreRepository; … … 48 46 49 47 @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(); 54 52 } 55 53
Note:
See TracChangeset
for help on using the changeset viewer.