source: Git/src/main/java/com/wediscussmovies/project/web/controller/GenreController.java@ 5b447b0

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 
1package com.wediscussmovies.project.web.controller;
2
3import com.wediscussmovies.project.service.GenreService;
4import org.springframework.stereotype.Controller;
5import org.springframework.ui.Model;
6import org.springframework.web.bind.annotation.GetMapping;
7import org.springframework.web.bind.annotation.RequestMapping;
8
9@Controller
10@RequestMapping("/genres")
11public 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.