- Timestamp:
- 01/09/24 01:26:08 (6 months ago)
- Branches:
- master
- Children:
- e272096
- Parents:
- b101b69
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/mk/ukim/finki/busngo/web/RegisterController.java
rb101b69 rbde8b13 1 1 package mk.ukim.finki.busngo.web; 2 2 3 import mk.ukim.finki.busngo.model.en ums.Role;3 import mk.ukim.finki.busngo.model.entities.Korisnik; 4 4 import mk.ukim.finki.busngo.model.exceptions.InvalidCredentialsException; 5 5 import mk.ukim.finki.busngo.model.exceptions.UserAlreadyExistsException; 6 6 import mk.ukim.finki.busngo.service.AuthService; 7 7 import mk.ukim.finki.busngo.service.KorisnikService; 8 import mk.ukim.finki.busngo.service.PatnikService; 8 9 import org.springframework.stereotype.Controller; 9 10 import org.springframework.ui.Model; … … 18 19 private final AuthService authService; 19 20 private final KorisnikService korisnikService; 21 private final PatnikService patnikService; 20 22 21 public RegisterController(AuthService authService, KorisnikService korisnikService ) {23 public RegisterController(AuthService authService, KorisnikService korisnikService, PatnikService patnikService) { 22 24 this.authService = authService; 23 25 this.korisnikService = korisnikService; 26 this.patnikService = patnikService; 24 27 } 25 28 … … 44 47 ) { 45 48 try{ 46 this.authService.register(name, email, password, confirmPassword, address, phone); 49 Korisnik korisnik = this.authService.registerPatnik(name, email, password, confirmPassword, address, phone); 50 this.patnikService.save(korisnik); 47 51 return "redirect:/login"; 48 52 } catch (InvalidCredentialsException | UserAlreadyExistsException exception) { … … 51 55 } 52 56 57 // @PostMapping 58 // public String registerVraboten(@RequestParam String name, 59 // @RequestParam String email, 60 // @RequestParam String password, 61 // @RequestParam String confirmPassword, 62 // @RequestParam String address, 63 // @RequestParam String phone){ 64 // 65 // } 66 53 67 }
Note:
See TracChangeset
for help on using the changeset viewer.