Changeset 4b1c93d for src/main/java/it
- Timestamp:
- 01/08/21 15:05:58 (4 years ago)
- Branches:
- master
- Children:
- 277b400
- Parents:
- 336d09e
- Location:
- src/main/java/it/finki/tinki
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/it/finki/tinki/model/dto/CompanyResponseDTO.java
r336d09e r4b1c93d 11 11 public class CompanyResponseDTO extends LoginResponseDTO { 12 12 private Address address; 13 private List<Job > jobs;14 private List<Internship > internships;13 private List<JobResponseDTO> jobs; 14 private List<InternshipResponseDTO> internships; 15 15 } -
src/main/java/it/finki/tinki/model/dto/TeamResponseDTO.java
r336d09e r4b1c93d 1 1 package it.finki.tinki.model.dto; 2 2 3 import it.finki.tinki.model.Jobs.Job;4 import it.finki.tinki.model.Jobs.Project;5 3 import lombok.Data; 6 4 … … 10 8 public class TeamResponseDTO extends LoginResponseDTO{ 11 9 private int members; 12 private List<Job > jobs;13 private List<Project > projects;10 private List<JobResponseDTO> jobs; 11 private List<ProjectResponseDTO> projects; 14 12 } -
src/main/java/it/finki/tinki/web/controller/LoginController.java
r336d09e r4b1c93d 32 32 this.workService = workService; 33 33 } 34 35 //TODO: ADD JOB/INTERNSHIP RESPONSE TYPE TO COMPANY AND TEAM ---------------------v36 34 37 35 @PostMapping(path = "/login") … … 90 88 tDto.setMembers(((Team) a1).getMembers()); 91 89 92 tDto.setJobs(this.workService.getAllJobsByAccount(a1.getId())); 93 tDto.setProjects(this.workService.getAllProjectsByAccount(a1.getId())); 90 List<Job> jobs = this.workService.getAllJobsByAccount(a1.getId()); 91 List<Project> projects = this.workService.getAllProjectsByAccount(a1.getId()); 92 93 jobs.forEach(job -> { 94 JobResponseDTO dto = new JobResponseDTO(job); 95 tDto.getJobs().add(dto); 96 }); 97 98 projects.forEach(project -> { 99 ProjectResponseDTO dto = new ProjectResponseDTO(project); 100 tDto.getProjects().add(dto); 101 }); 94 102 95 103 return tDto; … … 107 115 cDto.setAddress(((Company) a1).getAddress()); 108 116 109 cDto.setJobs(this.workService.getAllJobsByAccount(a1.getId())); 110 cDto.setInternships(this.workService.getAllInternshipsByAccount(a1.getId())); 117 List<Job> jobs = this.workService.getAllJobsByAccount(a1.getId()); 118 List<Internship> internships = this.workService.getAllInternshipsByAccount(a1.getId()); 119 120 jobs.forEach(job -> { 121 JobResponseDTO dto = new JobResponseDTO(job); 122 cDto.getJobs().add(dto); 123 }); 124 125 internships.forEach(internship -> { 126 InternshipResponseDTO dto = new InternshipResponseDTO(internship); 127 cDto.getInternships().add(dto); 128 }); 111 129 112 130 return cDto;
Note:
See TracChangeset
for help on using the changeset viewer.