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 | |
---|
1 | package com.example.demo.controller;
|
---|
2 |
|
---|
3 | import com.example.demo.model.MovieProjection;
|
---|
4 | import com.example.demo.repository.MovieProjectionRepository;
|
---|
5 | import org.springframework.stereotype.Controller;
|
---|
6 | import org.springframework.ui.Model;
|
---|
7 | import org.springframework.web.bind.annotation.RequestMapping;
|
---|
8 | import org.springframework.web.bind.annotation.RequestParam;
|
---|
9 |
|
---|
10 | import java.util.List;
|
---|
11 |
|
---|
12 | @Controller
|
---|
13 | @RequestMapping("/movie/projections")
|
---|
14 | public 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.