Changeset e272096 for src/main/java/mk/ukim/finki/busngo/web
- Timestamp:
- 02/18/24 22:01:54 (9 months ago)
- Branches:
- master
- Children:
- 4251327
- Parents:
- bde8b13
- Location:
- src/main/java/mk/ukim/finki/busngo/web
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/mk/ukim/finki/busngo/web/BiletController.java
rbde8b13 re272096 41 41 Patnik patnik = null; 42 42 try{ 43 patnik = patnikService.loadUserByEmail(authentication.getName()); 43 44 model.addAttribute("bileti", biletService.findAllByPatnikEmail(authentication.getName())); 44 45 } -
src/main/java/mk/ukim/finki/busngo/web/InstancaNaLinijaController.java
rbde8b13 re272096 71 71 72 72 @PostMapping("/{inlId}/end") 73 public String endInstanca(@PathVariable Long inlId){ 74 Instancanalinija ended = instancaNaLinijaService.end(inlId); 73 public String endInstanca(@PathVariable Long inlId, 74 Authentication authentication){ 75 Instancanalinija ended = instancaNaLinijaService.end(inlId, authentication.getName()); 75 76 return "redirect:/instanca-na-linija/" + ended.getInlId(); 76 77 } -
src/main/java/mk/ukim/finki/busngo/web/KaznaController.java
rbde8b13 re272096 9 9 import org.springframework.ui.Model; 10 10 import org.springframework.web.bind.annotation.GetMapping; 11 import org.springframework.web.bind.annotation.PathVariable; 12 import org.springframework.web.bind.annotation.PostMapping; 11 13 import org.springframework.web.bind.annotation.RequestMapping; 12 14 … … 37 39 return "master-template"; 38 40 } 41 42 @PostMapping("/{id}/pay") 43 public String pay(@PathVariable Long id, 44 Model model){ 45 kaznaZaRegistriranService.pay(id); 46 return "redirect:/kazna"; 47 } 48 39 49 } -
src/main/java/mk/ukim/finki/busngo/web/RegisterController.java
rbde8b13 re272096 2 2 3 3 import mk.ukim.finki.busngo.model.entities.Korisnik; 4 import mk.ukim.finki.busngo.model.enums.VrabotenType; 4 5 import mk.ukim.finki.busngo.model.exceptions.InvalidCredentialsException; 5 6 import mk.ukim.finki.busngo.model.exceptions.UserAlreadyExistsException; … … 34 35 } 35 36 37 model.addAttribute("types", VrabotenType.values()); 38 36 39 model.addAttribute("bodyContent", "register"); 37 40 return "master-template"; … … 44 47 @RequestParam String confirmPassword, 45 48 @RequestParam String address, 46 @RequestParam String phone 47 ) { 49 @RequestParam String phone, 50 @RequestParam(required = false)VrabotenType vrabotenType, 51 @RequestParam(required = false) Double salary 52 ) { 48 53 try{ 49 Korisnik korisnik = this.authService.registerPatnik(name, email, password, confirmPassword, address, phone); 50 this.patnikService.save(korisnik); 54 Korisnik korisnik; 55 if(vrabotenType != null){ 56 korisnik = this.authService.registerVraboten(name, email, password, confirmPassword, address, phone, vrabotenType, salary); 57 58 } 59 else 60 korisnik = this.authService.registerPatnik(name, email, password, confirmPassword, address, phone); 51 61 return "redirect:/login"; 52 62 } catch (InvalidCredentialsException | UserAlreadyExistsException exception) { -
src/main/java/mk/ukim/finki/busngo/web/VozenjeController.java
rbde8b13 re272096 4 4 import mk.ukim.finki.busngo.model.entities.Patnik; 5 5 import mk.ukim.finki.busngo.model.entities.Vozenje; 6 import mk.ukim.finki.busngo.model.enums.VOZENJE_STATUS; 6 7 import mk.ukim.finki.busngo.model.exceptions.InvalidPatnikIdException; 7 8 import mk.ukim.finki.busngo.model.exceptions.InvalidPostojkaNaLinijaIdException; … … 29 30 @GetMapping() 30 31 public String getVozenjePage(Model model, 31 Authentication authentication){ 32 Authentication authentication, 33 @RequestParam(required = false) VOZENJE_STATUS status){ 32 34 model.addAttribute("bodyContent", "listVozenja"); 33 35 Patnik patnik = null; 34 36 try{ 35 model.addAttribute("vozenja", vozenjeService.findVozenjaByPatnik(authentication.getName())); 37 if(status != null) 38 model.addAttribute("vozenja", vozenjeService.findVozenjaByPatnikAndStatus(authentication.getName(), status)); 39 else 40 model.addAttribute("vozenja", vozenjeService.findVozenjaByPatnikAndStatus(authentication.getName(), VOZENJE_STATUS.ACTIVE)); 41 model.addAttribute("vozStatus", VOZENJE_STATUS.values()); 36 42 } 37 43 catch (InvalidPatnikIdException e){
Note:
See TracChangeset
for help on using the changeset viewer.