Changeset f25e8dd in Git for src/main/java/com/wediscussmovies/project/web/controller/MovieController.java
- Timestamp:
- 02/05/22 22:48:19 (3 years ago)
- Branches:
- main
- Children:
- 2efe93e
- Parents:
- 5b447b0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/wediscussmovies/project/web/controller/MovieController.java
r5b447b0 rf25e8dd 61 61 } 62 62 63 @GetMapping("/{id}") 64 public String getMovie(@PathVariable Integer id, Model model){ 65 model.addAttribute("movie", movieService.findById(id)); 66 67 Authentication auth = SecurityContextHolder.getContext().getAuthentication(); 68 if (!(auth instanceof AnonymousAuthenticationToken)){ 69 UserDetails userDetails = (UserDetails) auth.getPrincipal(); 70 User user = (User) userDetails; 71 model.addAttribute("likedMovies",this.movieService.findLikedMoviesByUser(user)); 72 model.addAttribute("user",user); 73 } 74 75 model.addAttribute("contentTemplate", "movieShow"); 76 return "template"; 77 } 63 78 64 79 @GetMapping("/add")
Note:
See TracChangeset
for help on using the changeset viewer.