source: source/freeparkingspace/src/main/java/com/proekt/Controller/ReservationInfo.java@ 31d67c0

Last change on this file since 31d67c0 was 31d67c0, checked in by zlatko2810 <zlatko.stojanovski@…>, 22 months ago

proekt

  • Property mode set to 100644
File size: 1.1 KB
Line 
1package com.proekt.Controller;
2
3
4import com.proekt.Repository.ParkingMestoRepository;
5import org.springframework.stereotype.Controller;
6import org.springframework.ui.Model;
7import org.springframework.web.bind.annotation.GetMapping;
8import org.springframework.web.bind.annotation.RequestMapping;
9import org.springframework.web.bind.annotation.RequestParam;
10
11@Controller
12@RequestMapping("/reservation-info")
13public class ReservationInfo {
14
15 private final ParkingMestoRepository parkingMestoRepository;
16
17 public ReservationInfo(ParkingMestoRepository parkingMestoRepository) {
18 this.parkingMestoRepository = parkingMestoRepository;
19 }
20
21 @GetMapping
22 public String getRegisterPage(@RequestParam(required = false) String error, Model model) {
23 if(error != null && !error.isEmpty()) {
24 model.addAttribute("hasError", true);
25 model.addAttribute("error", error);
26 }
27 model.addAttribute("parking_mesto", this.parkingMestoRepository.findAll());
28 model.addAttribute("bodyContent","reservationInfo");
29 return "master-template";
30 }
31}
Note: See TracBrowser for help on using the repository browser.