Changeset c05cd97 for src/main/java


Ignore:
Timestamp:
02/08/23 12:10:11 (22 months ago)
Author:
milamihajlovska <mila.mihajlovska01@…>
Branches:
master
Children:
2a98e34
Parents:
afa6544
Message:

update i homeController for getFilmPage1 method

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/com/example/moviezone/web/HomeController.java

    rafa6544 rc05cd97  
    133133
    134134    }
    135     @GetMapping("/films")
    136     public String getFilmsPage(Model model){
    137         model.addAttribute("cinemas",cinemaService.findAllCinemas());
    138             List<FilmsReturnTable> pom=new LinkedList<>();
    139             model.addAttribute("films",pom);
    140             boolean h=pom.isEmpty();
    141             List<FilmsReturnTable> help=filmService.getFilmsFromCinema(2);
    142         model.addAttribute("bodyContent","films");
    143         return "master-template";
    144     }
    145 
    146     public String getFilmsPage1(Model model,Integer id_cinema){
    147         model.addAttribute("cinemas",cinemaService.findAllCinemas());
    148         if (id_cinema!=null) {
    149             model.addAttribute("films",filmService.getFilmsFromCinema(id_cinema.intValue()));
    150         }else{
    151             List<FilmsReturnTable> pom=new LinkedList<>();
    152             model.addAttribute("films",pom);
    153         }
    154 
    155         model.addAttribute("bodyContent","films");
    156         return "master-template";
    157     }
    158     @PostMapping("/getFilmsFromCinema")
    159     public String getFilmsFromCinema(@RequestParam Integer cinema, Model model){
    160         return getFilmsPage1(model,cinema);
    161     }
     135//    @GetMapping("/films")
     136//    public String getFilmsPage(Model model){
     137//        model.addAttribute("cinemas",cinemaService.findAllCinemas());
     138//            List<FilmsReturnTable> pom=new LinkedList<>();
     139//            model.addAttribute("films",pom);
     140//            boolean h=pom.isEmpty();
     141//            List<FilmsReturnTable> help=filmService.getFilmsFromCinema(2);
     142//        model.addAttribute("bodyContent","films");
     143//        return "master-template";
     144//    }
     145
     146//    @GetMapping("/films")
     147//    public String getFilmsPage1(Model model,@RequestParam(required = false) Integer id_cinema){
     148//        model.addAttribute("cinemas",cinemaService.findAllCinemas());
     149//        if (id_cinema!=null) {
     150//            model.addAttribute("films",filmService.getFilmsFromCinema(id_cinema));
     151//        }else{
     152////            List<FilmsReturnTable> pom=new LinkedList<>();
     153//            model.addAttribute("films",filmService.findAllFilms());
     154//        }
     155//        model.addAttribute("bodyContent","films");
     156//        return "master-template";
     157//    }
     158
     159//    @PostMapping("/getFilmsFromCinema")
     160//    public String getFilmsFromCinema(@RequestParam Integer cinema, Model model){
     161//        return getFilmsPage1(model,cinema);
     162//    }
    162163    @GetMapping("/projections")
    163164    public String getProjectionsPage(Model model)
Note: See TracChangeset for help on using the changeset viewer.