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