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
|
Rev | Line | |
---|
[31d67c0] | 1 | package com.proekt.Controller;
|
---|
| 2 |
|
---|
| 3 |
|
---|
| 4 | import com.proekt.Repository.ParkingMestoRepository;
|
---|
| 5 | import org.springframework.stereotype.Controller;
|
---|
| 6 | import org.springframework.ui.Model;
|
---|
| 7 | import org.springframework.web.bind.annotation.GetMapping;
|
---|
| 8 | import org.springframework.web.bind.annotation.RequestMapping;
|
---|
| 9 | import org.springframework.web.bind.annotation.RequestParam;
|
---|
| 10 |
|
---|
| 11 | @Controller
|
---|
| 12 | @RequestMapping("/reservation-info")
|
---|
| 13 | public 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.