Changeset 29c0ed0 for src/main/java/it/finki/tinki/controller
- Timestamp:
- 01/04/21 19:20:57 (4 years ago)
- Branches:
- master
- Children:
- 83a5af4
- Parents:
- efdb71a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/it/finki/tinki/controller/TestController.java
refdb71a r29c0ed0 1 1 package it.finki.tinki.controller; 2 2 3 import it.finki.tinki.helper.Matchmaker; 4 import it.finki.tinki.model.Jobs.Internship; 5 import it.finki.tinki.model.Jobs.Job; 6 import it.finki.tinki.model.Jobs.Work; 7 import it.finki.tinki.model.Skill; 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; 8 10 import it.finki.tinki.repository.JobRepository; 9 import org.springframework.web.bind.annotation.GetMapping; 10 import org.springframework.web.bind.annotation.RequestMapping; 11 import org.springframework.web.bind.annotation.RestController; 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.*; 12 15 13 import java.util. ArrayList;14 import java.util. List;16 import java.util.HashMap; 17 import java.util.Map; 15 18 16 19 @RestController 17 @RequestMapping("/ ")20 @RequestMapping("/api") 18 21 public class TestController { 19 22 20 JobRepository jobRepository;23 AccountService accountService; 21 24 22 public TestController( JobRepository jobRepository) {23 this. jobRepository = jobRepository;25 public TestController(AccountService accountService) { 26 this.accountService = accountService; 24 27 } 25 28 26 @GetMapping 27 public String testPage(){ 28 Matchmaker match = new Matchmaker(); 29 List<Skill> skills = new ArrayList<>(); 30 31 skills.add(new Skill("C++")); 32 skills.add(new Skill("Java")); 33 skills.add(new Skill("Python")); 34 35 List<Skill> user = new ArrayList<>(); 36 37 user.add(new Skill("Java")); 38 user.add(new Skill("Python")); 39 40 System.out.println(match.match(skills, user)); 41 42 return "Hello"; 29 @PostMapping(path = "/login") 30 public Account testPage(@RequestBody AccountLoginDataPojo body){ 31 return accountService.findUser(body.getAccount(), body.getPassword(), body.getType()); 43 32 } 44 33
Note:
See TracChangeset
for help on using the changeset viewer.