Changeset f067338 for src/main/java/it/finki/tinki/service/impl
- Timestamp:
- 01/09/21 03:04:38 (4 years ago)
- Branches:
- master
- Children:
- a3d2b0d
- Parents:
- 297bd16
- Location:
- src/main/java/it/finki/tinki/service/impl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/it/finki/tinki/service/impl/SkillServiceImpl.java
r297bd16 rf067338 29 29 return list; 30 30 } 31 32 public List<Skill> returnBasedOnText(String text){ 33 return this.skillRepository.findAllByNameContaining(text); 34 } 31 35 } -
src/main/java/it/finki/tinki/service/impl/WorkServiceImpl.java
r297bd16 rf067338 7 7 import it.finki.tinki.model.Skill; 8 8 import it.finki.tinki.model.Users.Account; 9 import it.finki.tinki.model.Work.Work; 10 import it.finki.tinki.model.dto.response.work.InternshipResponseDTO; 11 import it.finki.tinki.model.dto.response.work.JobResponseDTO; 12 import it.finki.tinki.model.dto.response.work.ProjectResponseDTO; 13 import it.finki.tinki.model.dto.response.work.WorkResponseDTO; 9 14 import it.finki.tinki.model.enumerator.AccountType; 10 15 import it.finki.tinki.repository.*; … … 15 20 import org.springframework.stereotype.Service; 16 21 17 import java.util.Date; 18 import java.util.List; 22 import java.util.*; 19 23 20 24 @Service … … 125 129 return jb; 126 130 } 131 132 @Override 133 public List<JobResponseDTO> fullTextJobSearch(String text) { 134 List<Skill> skills = this.skillService.returnBasedOnText(text); 135 136 List<Job> jobs = this.jobRepository.findAllByTitleContainsOrDescriptionContains(text,text); 137 List<Job> sjob = new ArrayList<>(); 138 139 skills.forEach(skill -> { 140 sjob.addAll(this.jobRepository.findAllBySkillsRequiredContaining(skill)); 141 }); 142 143 sjob.forEach(job -> { 144 if(!jobs.contains(job)){ 145 jobs.add(job); 146 } 147 }); 148 149 List<JobResponseDTO> jobs2 = new ArrayList<>(); 150 151 jobs.forEach(job -> { 152 jobs2.add(new JobResponseDTO(job)); 153 }); 154 155 return jobs2; 156 } 157 158 @Override 159 public List<InternshipResponseDTO> fullTextInternshipSearch(String text) { 160 List<Skill> skills = this.skillService.returnBasedOnText(text); 161 162 List<Internship> jobs = this.internshipRepository.findAllByTitleContainsOrDescriptionContains(text,text); 163 List<Internship> sjob = new ArrayList<>(); 164 165 skills.forEach(skill -> { 166 sjob.addAll(this.internshipRepository.findAllBySkillsTrainedContaining(skill)); 167 }); 168 169 sjob.forEach(job -> { 170 if(!jobs.contains(job)){ 171 jobs.add(job); 172 } 173 }); 174 175 List<InternshipResponseDTO> jobs2 = new ArrayList<>(); 176 177 jobs.forEach(job -> { 178 jobs2.add(new InternshipResponseDTO(job)); 179 }); 180 181 return jobs2; 182 } 183 184 @Override 185 public List<ProjectResponseDTO> fullTextProjectSearch(String text) { 186 List<Skill> skills = this.skillService.returnBasedOnText(text); 187 188 List<Project> jobs = this.projectRepository.findAllByTitleContainsOrDescriptionContains(text,text); 189 List<Project> sjob = new ArrayList<>(); 190 191 skills.forEach(skill -> { 192 sjob.addAll(this.projectRepository.findAllBySkillsRequiredContaining(skill)); 193 }); 194 195 sjob.forEach(job -> { 196 if(!jobs.contains(job)){ 197 jobs.add(job); 198 } 199 }); 200 201 List<ProjectResponseDTO> jobs2 = new ArrayList<>(); 202 203 jobs.forEach(job -> { 204 jobs2.add(new ProjectResponseDTO(job)); 205 }); 206 207 return jobs2; 208 } 127 209 }
Note:
See TracChangeset
for help on using the changeset viewer.