Changeset b31afbd for src/main/java/it/finki/tinki/web
- Timestamp:
- 01/08/21 03:13:23 (4 years ago)
- Branches:
- master
- Children:
- 336d09e
- Parents:
- b24fe9b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/it/finki/tinki/web/controller/RegisterController.java
rb24fe9b rb31afbd 8 8 import it.finki.tinki.model.Users.Account; 9 9 import it.finki.tinki.model.Users.User; 10 import it.finki.tinki.model.dto.UserRegisterDTO; 10 11 import it.finki.tinki.service.AccountService; 11 12 import it.finki.tinki.service.MatchmakerService; … … 36 37 37 38 @RequestMapping(path = "/user", method = RequestMethod.POST) 38 private Map<String, String> registerUser(@RequestParam String email, 39 @RequestParam String password, 40 @RequestParam String name, 41 @RequestParam String surname, 42 @RequestParam List<Long> retainedSkills, 43 @RequestParam List<Long> skillsToLearn){ 39 private Map<String, String> registerUser(@RequestBody UserRegisterDTO body){ 44 40 45 List<Skill> retained = this.skillService.returnSkillsBasedOnId( retainedSkills);46 List<Skill> toLearn = this.skillService.returnSkillsBasedOnId( skillsToLearn);41 List<Skill> retained = this.skillService.returnSkillsBasedOnId(body.getRetainedSkills()); 42 List<Skill> toLearn = this.skillService.returnSkillsBasedOnId(body.getSkillsToLearn()); 47 43 48 Account k = this.accountService.registerUser( email, password, name, surname, retained, toLearn);44 Account k = this.accountService.registerUser(body.getEmail(), body.getPassword(), body.getName(), body.getSurname(), retained, toLearn); 49 45 50 46 Map<String, String> response = new HashMap<>(); … … 60 56 61 57 @RequestMapping(path = "/team", method = RequestMethod.POST) 62 private Map<String, String> registerTeam(@Request ParamString email,63 @Request ParamString password,64 @Request ParamString name,65 @Request Paramint members){58 private Map<String, String> registerTeam(@RequestBody String email, 59 @RequestBody String password, 60 @RequestBody String name, 61 @RequestBody int members){ 66 62 67 63 Account k = this.accountService.registerTeam(email, password, name, members); … … 79 75 80 76 @RequestMapping(path = "/company", method = RequestMethod.POST) 81 private Map<String, String> registeCompany(@Request ParamString email,82 @Request ParamString password,83 @Request ParamString name,84 @Request ParamString country,85 @Request ParamString city,86 @Request ParamString street){77 private Map<String, String> registeCompany(@RequestBody String email, 78 @RequestBody String password, 79 @RequestBody String name, 80 @RequestBody String country, 81 @RequestBody String city, 82 @RequestBody String street){ 87 83 88 84 Account k = this.accountService.registerCompany(email, password, name, country, city, street);
Note:
See TracChangeset
for help on using the changeset viewer.