Last change
on this file since 4cec0a3 was a8e8545, checked in by Vzdra <vladko.zdravkovski@…>, 3 years ago |
added dummy data for user skills and fixed bugs
|
-
Property mode
set to
100644
|
File size:
830 bytes
|
Line | |
---|
1 | package it.finki.tinki.service.impl;
|
---|
2 |
|
---|
3 | import it.finki.tinki.model.Skill;
|
---|
4 | import it.finki.tinki.model.exception.SkillNotFoundException;
|
---|
5 | import it.finki.tinki.repository.SkillRepository;
|
---|
6 | import it.finki.tinki.service.SkillService;
|
---|
7 | import org.springframework.stereotype.Service;
|
---|
8 |
|
---|
9 | import java.util.ArrayList;
|
---|
10 | import java.util.List;
|
---|
11 |
|
---|
12 | @Service
|
---|
13 | public class SkillServiceImpl implements SkillService {
|
---|
14 |
|
---|
15 | SkillRepository skillRepository;
|
---|
16 |
|
---|
17 | public SkillServiceImpl(SkillRepository skillRepository) {
|
---|
18 | this.skillRepository = skillRepository;
|
---|
19 | }
|
---|
20 |
|
---|
21 | @Override
|
---|
22 | public List<Skill> returnSkillsBasedOnId(List<Long> skillIds) {
|
---|
23 |
|
---|
24 | List<Skill> list = new ArrayList<>();
|
---|
25 |
|
---|
26 | skillIds.forEach(skill -> {
|
---|
27 | this.skillRepository.findById(skill).ifPresent(list::add);
|
---|
28 | });
|
---|
29 |
|
---|
30 | return list;
|
---|
31 | }
|
---|
32 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.