Changeset 297bd16 for src/main/java/it/finki/tinki/service/impl
- Timestamp:
- 01/09/21 01:07:09 (4 years ago)
- Branches:
- master
- Children:
- f067338
- Parents:
- bd46dbb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/it/finki/tinki/service/impl/WorkServiceImpl.java
rbd46dbb r297bd16 1 1 package it.finki.tinki.service.impl; 2 2 3 import it.finki.tinki.model.Users.User; 3 4 import it.finki.tinki.model.Work.Internship; 4 5 import it.finki.tinki.model.Work.Job; … … 7 8 import it.finki.tinki.model.Users.Account; 8 9 import it.finki.tinki.model.enumerator.AccountType; 9 import it.finki.tinki.repository.InternshipRepository; 10 import it.finki.tinki.repository.JobRepository; 11 import it.finki.tinki.repository.MatchRepository; 12 import it.finki.tinki.repository.ProjectRepository; 10 import it.finki.tinki.repository.*; 13 11 import it.finki.tinki.service.AccountService; 12 import it.finki.tinki.service.MatchmakerService; 14 13 import it.finki.tinki.service.SkillService; 15 14 import it.finki.tinki.service.WorkService; … … 26 25 ProjectRepository projectRepository; 27 26 MatchRepository matchRepository; 27 MatchmakerService matchmakerService; 28 28 SkillService skillService; 29 29 AccountService accountService; 30 UserRepository userRepository; 30 31 31 32 public WorkServiceImpl(JobRepository jobRepository, … … 34 35 MatchRepository matchRepository, 35 36 SkillService skillService, 36 AccountService accountService) { 37 AccountService accountService, 38 UserRepository userRepository, 39 MatchmakerService matchmakerService) { 37 40 this.jobRepository = jobRepository; 38 41 this.internshipRepository = internshipRepository; … … 41 44 this.skillService = skillService; 42 45 this.accountService = accountService; 46 this.userRepository = userRepository; 47 this.matchmakerService = matchmakerService; 43 48 } 44 49 … … 78 83 Account account = this.accountService.findByIdAndType(adccId, type); 79 84 Job j = new Job(title, description, account, salary, skills); 80 return this.jobRepository.save(j); 85 Job jb = this.jobRepository.save(j); 86 87 List<User> users = this.userRepository.findAll(); 88 89 users.forEach(user -> { 90 this.matchmakerService.setUpUserJobMatches(jb, user); 91 }); 92 93 return jb; 81 94 } 82 95 … … 86 99 Account account = this.accountService.findByIdAndType(adccId, type); 87 100 Internship j = new Internship(title, description, account, salary, skills, openSpots); 88 return this.internshipRepository.save(j); 101 Internship jb = this.internshipRepository.save(j); 102 103 List<User> users = this.userRepository.findAll(); 104 105 users.forEach(user -> { 106 this.matchmakerService.setUpUserInternshipMatches(jb, user); 107 }); 108 109 return jb; 89 110 } 90 111 … … 94 115 Account account = this.accountService.findByIdAndType(adccId, type); 95 116 Project j = new Project(title, description, account, salary, skills, validUntil); 96 return this.projectRepository.save(j); 117 Project jb = this.projectRepository.save(j); 118 119 List<User> users = this.userRepository.findAll(); 120 121 users.forEach(user -> { 122 this.matchmakerService.setUpUserProjectMatches(jb, user); 123 }); 124 125 return jb; 97 126 } 98 127 }
Note:
See TracChangeset
for help on using the changeset viewer.