Last change
on this file since 29c0ed0 was 29c0ed0, checked in by Vzdra <vladko.zdravkovski@…>, 3 years ago |
added initial login functionality
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Rev | Line | |
---|
[bfa113e] | 1 | package it.finki.tinki.controller;
|
---|
| 2 |
|
---|
[29c0ed0] | 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;
|
---|
[7987457] | 10 | import it.finki.tinki.repository.JobRepository;
|
---|
[29c0ed0] | 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.*;
|
---|
[bfa113e] | 15 |
|
---|
[29c0ed0] | 16 | import java.util.HashMap;
|
---|
| 17 | import java.util.Map;
|
---|
[bfa113e] | 18 |
|
---|
| 19 | @RestController
|
---|
[29c0ed0] | 20 | @RequestMapping("/api")
|
---|
[bfa113e] | 21 | public class TestController {
|
---|
| 22 |
|
---|
[29c0ed0] | 23 | AccountService accountService;
|
---|
[7987457] | 24 |
|
---|
[29c0ed0] | 25 | public TestController(AccountService accountService) {
|
---|
| 26 | this.accountService = accountService;
|
---|
[7987457] | 27 | }
|
---|
| 28 |
|
---|
[29c0ed0] | 29 | @PostMapping(path = "/login")
|
---|
| 30 | public Account testPage(@RequestBody AccountLoginDataPojo body){
|
---|
| 31 | return accountService.findUser(body.getAccount(), body.getPassword(), body.getType());
|
---|
[bfa113e] | 32 | }
|
---|
| 33 |
|
---|
| 34 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.