- Timestamp:
- 01/04/21 20:04:57 (4 years ago)
- Branches:
- master
- Children:
- f36822a
- Parents:
- 29c0ed0
- Location:
- src/main
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/it/finki/tinki/controller/TestController.java
r29c0ed0 r83a5af4 2 2 3 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 4 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; 5 import it.finki.tinki.model.pojo.AuthResponseDataPojo; 13 6 import it.finki.tinki.service.AccountService; 14 7 import org.springframework.web.bind.annotation.*; 15 16 import java.util.HashMap; 17 import java.util.Map; 8 import org.springframework.web.server.ResponseStatusException; 18 9 19 10 @RestController … … 28 19 29 20 @PostMapping(path = "/login") 30 public Account testPage(@RequestBody AccountLoginDataPojo body){ 31 return accountService.findUser(body.getAccount(), body.getPassword(), body.getType()); 21 public AuthResponseDataPojo testPage(@RequestBody AccountLoginDataPojo body) throws ResponseStatusException { 22 Account a1 = accountService.findUser(body.getAccount(), body.getPassword(), body.getType()); 23 AuthResponseDataPojo resp = new AuthResponseDataPojo(); 24 25 if(a1!=null){ 26 resp.setId(a1.getId()); 27 resp.setEmail(a1.getEmail()); 28 resp.setName(a1.getName()); 29 resp.setType(a1.getAccountType()); 30 } 31 32 return resp; 32 33 } 33 34 -
src/main/resources/application.properties
r29c0ed0 r83a5af4 1 server.port= 30001 server.port=9090 2 2 3 3 spring.datasource.url=jdbc:h2:mem:testdb
Note:
See TracChangeset
for help on using the changeset viewer.