|
Last change
on this file since 09e02d7 was 09e02d7, checked in by Nikola Sarafimov <sarafimov.nikola12345@…>, 3 days ago |
|
Final room reservation system implementation
|
-
Property mode
set to
100644
|
|
File size:
1.1 KB
|
| Line | |
|---|
| 1 | package mk.finki.roomreservation.controller;
|
|---|
| 2 |
|
|---|
| 3 | import mk.finki.roomreservation.model.ActivateAccountRequest;
|
|---|
| 4 | import mk.finki.roomreservation.model.LoginRequest;
|
|---|
| 5 | import mk.finki.roomreservation.model.RegisterRequest;
|
|---|
| 6 | import mk.finki.roomreservation.model.UserOption;
|
|---|
| 7 | import mk.finki.roomreservation.service.AuthService;
|
|---|
| 8 | import org.springframework.web.bind.annotation.*;
|
|---|
| 9 |
|
|---|
| 10 | @RestController
|
|---|
| 11 | @RequestMapping("/api/auth")
|
|---|
| 12 | public class AuthController {
|
|---|
| 13 |
|
|---|
| 14 | private final AuthService authService;
|
|---|
| 15 |
|
|---|
| 16 | public AuthController(AuthService authService) {
|
|---|
| 17 | this.authService = authService;
|
|---|
| 18 | }
|
|---|
| 19 |
|
|---|
| 20 | @PostMapping("/login")
|
|---|
| 21 | public UserOption login(@RequestBody LoginRequest request) {
|
|---|
| 22 | return authService.login(request);
|
|---|
| 23 | }
|
|---|
| 24 |
|
|---|
| 25 | @PostMapping("/register")
|
|---|
| 26 | public UserOption register(@RequestBody RegisterRequest request) {
|
|---|
| 27 | return authService.register(request);
|
|---|
| 28 | }
|
|---|
| 29 |
|
|---|
| 30 | @PostMapping("/activate")
|
|---|
| 31 | public UserOption activateExistingAccount(@RequestBody ActivateAccountRequest request) {
|
|---|
| 32 | return authService.activateExistingAccount(request);
|
|---|
| 33 | }
|
|---|
| 34 | } |
|---|
Note:
See
TracBrowser
for help on using the repository browser.