Changeset 42d565b in Git for src/main/java/com/wediscussmovies/project/web/controller/UsersController.java
- Timestamp:
- 02/06/22 21:38:16 (3 years ago)
- Branches:
- main
- Children:
- 7f36551
- Parents:
- 5b447b0 (diff), 2efe93e (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. - git-author:
- Mato-77 <56981531+Mato-77@…> (02/06/22 21:38:16)
- git-committer:
- GitHub <noreply@…> (02/06/22 21:38:16)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/wediscussmovies/project/web/controller/UsersController.java
r5b447b0 r42d565b 3 3 4 4 import com.wediscussmovies.project.LoggedUser; 5 import com.wediscussmovies.project.model.Movie; 5 6 import com.wediscussmovies.project.model.exception.InvalidArgumentsException; 6 7 import com.wediscussmovies.project.model.exception.PasswordsDoNotMatchException; … … 13 14 import org.springframework.web.bind.annotation.RequestMapping; 14 15 import org.springframework.web.bind.annotation.RequestParam; 16 17 import java.util.ArrayList; 18 import java.util.List; 15 19 16 20 @Controller … … 59 63 @GetMapping("/favoriteList") 60 64 public String getFavoriteList(Model model){ 61 model.addAttribute("movies",this.movieService.findLikedMoviesByUser(LoggedUser.getLoggedUser())); 65 List<Movie> movieList = this.movieService.findLikedMoviesByUser(LoggedUser.getLoggedUser()); 66 List<List<Movie>> movie_rows = new ArrayList<>(); 67 for(int i=0; i<movieList.size(); i+=4){ 68 int j = i+4; 69 if(j>movieList.size()) 70 j= movieList.size(); 71 movie_rows.add(movieList.subList(i, j)); 72 } 73 model.addAttribute("movie_rows", movie_rows); 62 74 model.addAttribute("contentTemplate","favoriteList"); 63 75 return "template";
Note:
See TracChangeset
for help on using the changeset viewer.