Last change
on this file since 29c0ed0 was 29c0ed0, checked in by Vzdra <vladko.zdravkovski@…>, 4 years ago |
added initial login functionality
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | package it.finki.tinki.controller;
|
---|
2 |
|
---|
3 | import it.finki.tinki.model.Users.Account;
|
---|
4 | import it.finki.tinki.model.Users.Company;
|
---|
5 | import it.finki.tinki.model.Users.Team;
|
---|
6 | import it.finki.tinki.model.Users.User;
|
---|
7 | import it.finki.tinki.model.enumerator.AccountType;
|
---|
8 | import it.finki.tinki.model.pojo.AccountLoginDataPojo;
|
---|
9 | import it.finki.tinki.repository.CompanyRepository;
|
---|
10 | import it.finki.tinki.repository.JobRepository;
|
---|
11 | import it.finki.tinki.repository.TeamRepository;
|
---|
12 | import it.finki.tinki.repository.UserRepository;
|
---|
13 | import it.finki.tinki.service.AccountService;
|
---|
14 | import org.springframework.web.bind.annotation.*;
|
---|
15 |
|
---|
16 | import java.util.HashMap;
|
---|
17 | import java.util.Map;
|
---|
18 |
|
---|
19 | @RestController
|
---|
20 | @RequestMapping("/api")
|
---|
21 | public class TestController {
|
---|
22 |
|
---|
23 | AccountService accountService;
|
---|
24 |
|
---|
25 | public TestController(AccountService accountService) {
|
---|
26 | this.accountService = accountService;
|
---|
27 | }
|
---|
28 |
|
---|
29 | @PostMapping(path = "/login")
|
---|
30 | public Account testPage(@RequestBody AccountLoginDataPojo body){
|
---|
31 | return accountService.findUser(body.getAccount(), body.getPassword(), body.getType());
|
---|
32 | }
|
---|
33 |
|
---|
34 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.