Changeset 4b1c93d for src/main/java/it/finki/tinki/web
- Timestamp:
- 01/08/21 15:05:58 (4 years ago)
- Branches:
- master
- Children:
- 277b400
- Parents:
- 336d09e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.