Ignore:
Timestamp:
01/08/21 23:47:41 (4 years ago)
Author:
Vzdra <vladko.zdravkovski@…>
Branches:
master
Children:
297bd16
Parents:
bd38a55
Message:

refactoring and response dto

Location:
src/main/java/it/finki/tinki/web/controller
Files:
1 added
1 deleted
3 edited

Legend:

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

    rbd38a55 rbd46dbb  
    22
    33import it.finki.tinki.model.Skill;
    4 import it.finki.tinki.model.Users.Account;
    54import it.finki.tinki.model.Users.Company;
    65import it.finki.tinki.model.Users.Team;
    76import it.finki.tinki.model.Users.User;
    8 import it.finki.tinki.model.dto.*;
     7import it.finki.tinki.model.dto.register.account.CompanyRegisterDTO;
     8import it.finki.tinki.model.dto.register.account.TeamRegisterDTO;
     9import it.finki.tinki.model.dto.register.account.UserRegisterDTO;
     10import it.finki.tinki.model.dto.response.account.CompanyResponseDTO;
     11import it.finki.tinki.model.dto.response.account.TeamResponseDTO;
     12import it.finki.tinki.model.dto.response.account.UserResponseDTO;
    913import it.finki.tinki.model.enumerator.AccountType;
    1014import it.finki.tinki.service.AccountService;
    1115import it.finki.tinki.service.SkillService;
    12 import org.springframework.web.bind.annotation.PathVariable;
    13 import org.springframework.web.bind.annotation.RequestBody;
    14 import org.springframework.web.bind.annotation.RequestMapping;
    15 import org.springframework.web.bind.annotation.RestController;
     16import org.springframework.web.bind.annotation.*;
    1617
    1718import java.util.List;
     
    3031    }
    3132
    32     @RequestMapping(path = "/user/{id}/{email}")
     33    @PostMapping(path = "/user/{id}/{email}")
    3334    public UserResponseDTO editUser(@PathVariable(name = "id") Long id,
    3435                                    @PathVariable(name = "email") String email,
     
    4849            userResponseDTO.setEmail(u.getEmail());
    4950            userResponseDTO.setType(AccountType.USER);
     51            userResponseDTO.setError(null);
    5052            userResponseDTO.setName(u.getName());
    5153            userResponseDTO.setSurname(u.getSurname());
     
    5961    }
    6062
    61     @RequestMapping(path = "/company/{id}/{email}")
     63    @PostMapping(path = "/company/{id}/{email}")
    6264    public CompanyResponseDTO editCompany(@PathVariable(name = "id") Long id,
    6365                                          @PathVariable(name = "email") String email,
     
    7375            companyResponseDTO.setId(c.getId());
    7476            companyResponseDTO.setEmail(c.getEmail());
     77            companyResponseDTO.setError(null);
    7578            companyResponseDTO.setType(AccountType.COMPANY);
    7679            companyResponseDTO.setName(c.getName());
     
    8386    }
    8487
    85     @RequestMapping(path = "/team/{id}/{email}")
     88    @PostMapping(path = "/team/{id}/{email}")
    8689    public TeamResponseDTO editTeam(@PathVariable(name = "id") Long id,
    8790                                    @PathVariable(name = "email") String email,
     
    97100            teamResponseDTO.setId(t.getId());
    98101            teamResponseDTO.setEmail(t.getEmail());
     102            teamResponseDTO.setError(null);
    99103            teamResponseDTO.setType(AccountType.TEAM);
    100104            teamResponseDTO.setName(t.getName());
  • src/main/java/it/finki/tinki/web/controller/LoginController.java

    rbd38a55 rbd46dbb  
    11package it.finki.tinki.web.controller;
    22
    3 import it.finki.tinki.model.Jobs.Internship;
    4 import it.finki.tinki.model.Jobs.Job;
    5 import it.finki.tinki.model.Jobs.Project;
     3import it.finki.tinki.model.Work.Internship;
     4import it.finki.tinki.model.Work.Job;
     5import it.finki.tinki.model.Work.Project;
    66import it.finki.tinki.model.Users.Account;
    77import it.finki.tinki.model.Users.Company;
     
    99import it.finki.tinki.model.Users.User;
    1010import it.finki.tinki.model.dto.*;
     11import it.finki.tinki.model.dto.response.account.LoginResponseDTO;
     12import it.finki.tinki.model.dto.response.account.CompanyResponseDTO;
     13import it.finki.tinki.model.dto.response.account.TeamResponseDTO;
     14import it.finki.tinki.model.dto.response.account.UserResponseDTO;
     15import it.finki.tinki.model.dto.response.work.InternshipResponseDTO;
     16import it.finki.tinki.model.dto.response.work.JobResponseDTO;
     17import it.finki.tinki.model.dto.response.work.ProjectResponseDTO;
    1118import it.finki.tinki.model.enumerator.AccountType;
    1219import it.finki.tinki.service.AccountService;
  • src/main/java/it/finki/tinki/web/controller/RegisterController.java

    rbd38a55 rbd46dbb  
    33import it.finki.tinki.model.Skill;
    44import it.finki.tinki.model.Users.Account;
    5 import it.finki.tinki.model.dto.CompanyRegisterDTO;
    6 import it.finki.tinki.model.dto.TeamRegisterDTO;
    7 import it.finki.tinki.model.dto.UserRegisterDTO;
     5import it.finki.tinki.model.dto.register.account.CompanyRegisterDTO;
     6import it.finki.tinki.model.dto.register.account.TeamRegisterDTO;
     7import it.finki.tinki.model.dto.register.account.UserRegisterDTO;
    88import it.finki.tinki.service.AccountService;
    99import it.finki.tinki.service.MatchmakerService;
Note: See TracChangeset for help on using the changeset viewer.