Changeset a3d2b0d for src/main/java/it/finki/tinki
- Timestamp:
- 01/09/21 03:40:07 (4 years ago)
- Branches:
- master
- Children:
- 17abe5e
- Parents:
- f067338
- Location:
- src/main/java/it/finki/tinki
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/it/finki/tinki/service/WorkService.java
rf067338 ra3d2b0d 17 17 List<Internship> getAllInternshipsByAccount(Long accId); 18 18 List<Project> getAllProjectsByAccount(Long accId); 19 List<Job> getAllJobs();20 List<Internship> getAllInternships();21 List<Project> getAllProjects();22 19 Job insertJob(String title, String description, Long accId, int salary, List<Long> skillsRequired, AccountType type); 23 20 Internship insertInternship(String title, String description, Long adccId, int salary, List<Long> skillsTrained, int openSpots, AccountType type); 24 21 Project insertProject(String title, String description, Long adccId, int salary, List<Long> skillsRequired, Date validUntil, AccountType type); 22 Job editJob(Long id, String title, String description, int salary); 23 Internship editInternship(Long id, String title, String description, int salary, int openSpots); 24 Project editProject(Long id, String title, String description, int salary); 25 25 List<JobResponseDTO> fullTextJobSearch(String text); 26 26 List<InternshipResponseDTO> fullTextInternshipSearch(String text); 27 27 List<ProjectResponseDTO> fullTextProjectSearch(String text); 28 Job getJobById(Long id); 29 Internship getInternshipById(Long id); 30 Project getProjectById(Long id); 28 31 } -
src/main/java/it/finki/tinki/service/impl/WorkServiceImpl.java
rf067338 ra3d2b0d 68 68 69 69 @Override 70 public List<Job> getAllJobs() {71 return this.jobRepository.findAll();72 }73 74 @Override75 public List<Internship> getAllInternships() {76 return this.internshipRepository.findAll();77 }78 79 @Override80 public List<Project> getAllProjects() {81 return this.projectRepository.findAll();82 }83 84 @Override85 70 public Job insertJob(String title, String description, Long adccId, int salary, List<Long> skillsRequired, AccountType type) { 86 71 List<Skill> skills = this.skillService.returnSkillsBasedOnId(skillsRequired); … … 131 116 132 117 @Override 118 public Job editJob(Long id, String title, String description, int salary) { 119 Job j = this.jobRepository.findById(id).get(); 120 121 j.setTitle(title); 122 j.setDescription(description); 123 j.setSalary(salary); 124 125 return this.jobRepository.save(j); 126 } 127 128 @Override 129 public Internship editInternship(Long id, String title, String description, int salary, int openSpots) { 130 Internship j = this.internshipRepository.findById(id).get(); 131 132 j.setTitle(title); 133 j.setDescription(description); 134 j.setSalary(salary); 135 136 return this.internshipRepository.save(j); 137 } 138 139 @Override 140 public Project editProject(Long id, String title, String description, int salary) { 141 Project j = this.projectRepository.findById(id).get(); 142 143 j.setTitle(title); 144 j.setDescription(description); 145 j.setSalary(salary); 146 147 return this.projectRepository.save(j); 148 } 149 150 @Override 133 151 public List<JobResponseDTO> fullTextJobSearch(String text) { 134 152 List<Skill> skills = this.skillService.returnBasedOnText(text); … … 207 225 return jobs2; 208 226 } 227 228 @Override 229 public Job getJobById(Long id) { 230 return this.jobRepository.findById(id).get(); 231 } 232 233 @Override 234 public Internship getInternshipById(Long id) { 235 return this.internshipRepository.findById(id).get(); 236 } 237 238 @Override 239 public Project getProjectById(Long id) { 240 return this.projectRepository.findById(id).get(); 241 } 209 242 } -
src/main/java/it/finki/tinki/web/controller/WorkRegisterController.java
rf067338 ra3d2b0d 12 12 import it.finki.tinki.service.WorkService; 13 13 import org.springframework.web.bind.annotation.*; 14 15 import java.util.List;16 14 17 15 @RestController
Note:
See TracChangeset
for help on using the changeset viewer.