Ignore:
Timestamp:
01/08/21 16:32:00 (4 years ago)
Author:
Vzdra <vladko.zdravkovski@…>
Branches:
master
Children:
14b648e
Parents:
277b400
Message:

finalized register logic

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/it/finki/tinki/web/controller/RegisterController.java

    r277b400 r31fc5c8  
    33import it.finki.tinki.model.Skill;
    44import it.finki.tinki.model.Users.Account;
     5import it.finki.tinki.model.dto.CompanyRegisterDTO;
     6import it.finki.tinki.model.dto.TeamRegisterDTO;
    57import it.finki.tinki.model.dto.UserRegisterDTO;
    68import it.finki.tinki.service.AccountService;
     
    5052    }
    5153
    52     //TODO: ADD TEAM AND COMPANY REGISTER TDO --------------------------------------v
     54    @RequestMapping(path = "/team", method = RequestMethod.POST)
     55    private Map<String, String> registerTeam(@RequestBody TeamRegisterDTO body){
    5356
    54     @RequestMapping(path = "/team", method = RequestMethod.POST)
    55     private Map<String, String> registerTeam(@RequestBody String email,
    56                                              @RequestBody String password,
    57                                              @RequestBody String name,
    58                                              @RequestBody int members){
    59 
    60         Account k = this.accountService.registerTeam(email, password, name, members);
     57        Account k = this.accountService.registerTeam(body.getEmail(), body.getPassword(), body.getName(), body.getMembers());
    6158
    6259        Map<String, String> response = new HashMap<>();
     
    7269
    7370    @RequestMapping(path = "/company", method = RequestMethod.POST)
    74     private Map<String, String> registeCompany(@RequestBody String email,
    75                                                @RequestBody String password,
    76                                                @RequestBody String name,
    77                                                @RequestBody String country,
    78                                                @RequestBody String city,
    79                                                @RequestBody String street){
     71    private Map<String, String> registeCompany(@RequestBody CompanyRegisterDTO body){
    8072
    81         Account k = this.accountService.registerCompany(email, password, name, country, city, street);
     73        Account k = this.accountService.registerCompany(body.getEmail(),
     74                body.getPassword(), body.getName(), body.getCountry(), body.getCity(), body.getStreet());
    8275
    8376        Map<String, String> response = new HashMap<>();
Note: See TracChangeset for help on using the changeset viewer.