source: source/MovieZilla-master/src/main/java/com/example/demo/controller/DetailedMovieView.java

Last change on this file was fc7ec52, checked in by darkopopovski <darkopopovski39@…>, 2 years ago

all files

  • Property mode set to 100644
File size: 1.0 KB
Line 
1package com.example.demo.controller;
2
3import com.example.demo.model.MovieProjection;
4import com.example.demo.repository.MovieProjectionRepository;
5import org.springframework.stereotype.Controller;
6import org.springframework.ui.Model;
7import org.springframework.web.bind.annotation.RequestMapping;
8import org.springframework.web.bind.annotation.RequestParam;
9
10import java.util.List;
11
12@Controller
13@RequestMapping("/movie/projections")
14public class DetailedMovieView {
15
16 private final MovieProjectionRepository movieProjectionRepository;
17
18 public DetailedMovieView(MovieProjectionRepository movieProjectionRepository) {
19 this.movieProjectionRepository = movieProjectionRepository;
20 }
21
22 @RequestMapping("/detailed-preview/")
23 public String viewMovieDetail(@RequestParam(value = "movie_id", required = false) Integer movie_id, Model model) {
24 List<MovieProjection> moviegoer = movieProjectionRepository.findByMovieID(movie_id);
25 model.addAttribute("moviegoer", moviegoer);
26 return "view";
27 }
28}
Note: See TracBrowser for help on using the repository browser.