Ignore:
Timestamp:
01/09/24 01:26:08 (6 months ago)
Author:
ppaunovski <paunovskipavel@…>
Branches:
master
Children:
e272096
Parents:
b101b69
Message:

All 3 main use cases implemented.

  1. Starting a commute
  2. Writing a ticket
  3. Starting an instance of a Bus Line
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/mk/ukim/finki/busngo/web/RegisterController.java

    rb101b69 rbde8b13  
    11package mk.ukim.finki.busngo.web;
    22
    3 import mk.ukim.finki.busngo.model.enums.Role;
     3import mk.ukim.finki.busngo.model.entities.Korisnik;
    44import mk.ukim.finki.busngo.model.exceptions.InvalidCredentialsException;
    55import mk.ukim.finki.busngo.model.exceptions.UserAlreadyExistsException;
    66import mk.ukim.finki.busngo.service.AuthService;
    77import mk.ukim.finki.busngo.service.KorisnikService;
     8import mk.ukim.finki.busngo.service.PatnikService;
    89import org.springframework.stereotype.Controller;
    910import org.springframework.ui.Model;
     
    1819    private final AuthService authService;
    1920    private final KorisnikService korisnikService;
     21    private final PatnikService patnikService;
    2022
    21     public RegisterController(AuthService authService, KorisnikService korisnikService) {
     23    public RegisterController(AuthService authService, KorisnikService korisnikService, PatnikService patnikService) {
    2224        this.authService = authService;
    2325        this.korisnikService = korisnikService;
     26        this.patnikService = patnikService;
    2427    }
    2528
     
    4447    ) {
    4548        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);
    4751            return "redirect:/login";
    4852        } catch (InvalidCredentialsException | UserAlreadyExistsException exception) {
     
    5155    }
    5256
     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
    5367}
Note: See TracChangeset for help on using the changeset viewer.