Last change
on this file since 9d4220d was 4a15c9c, checked in by i-ina <76742075+i-ina@…>, 3 years ago |
added user registration
|
-
Property mode
set to
100644
|
File size:
847 bytes
|
Rev | Line | |
---|
[4a15c9c] | 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<Integer> skillIds) {
|
---|
| 23 |
|
---|
| 24 | List<Skill> list = new ArrayList<>();
|
---|
| 25 |
|
---|
| 26 | skillIds.forEach(skill -> {
|
---|
| 27 | this.skillRepository.findById(Long.valueOf(skill)).ifPresent(list::add);
|
---|
| 28 | });
|
---|
| 29 |
|
---|
| 30 | return list;
|
---|
| 31 | }
|
---|
| 32 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.