main
Last change
on this file since 5b447b0 was 5b447b0, checked in by Test <matonikolov77@…>, 2 years ago |
Adding models and resources
|
-
Property mode
set to
100644
|
File size:
759 bytes
|
Line | |
---|
1 | package com.wediscussmovies.project.web.controller;
|
---|
2 |
|
---|
3 | import com.wediscussmovies.project.service.GenreService;
|
---|
4 | import org.springframework.stereotype.Controller;
|
---|
5 | import org.springframework.ui.Model;
|
---|
6 | import org.springframework.web.bind.annotation.GetMapping;
|
---|
7 | import org.springframework.web.bind.annotation.RequestMapping;
|
---|
8 |
|
---|
9 | @Controller
|
---|
10 | @RequestMapping("/genres")
|
---|
11 | public class GenreController {
|
---|
12 | private final GenreService genreService;
|
---|
13 |
|
---|
14 | public GenreController(GenreService genreService) {
|
---|
15 | this.genreService = genreService;
|
---|
16 | }
|
---|
17 | @GetMapping
|
---|
18 | public String getGenres(Model model){
|
---|
19 | model.addAttribute("genres",genreService.findAllWithLikes());
|
---|
20 | model.addAttribute("contentTemplate","genres");
|
---|
21 | return "template";
|
---|
22 | }
|
---|
23 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.