Revize 16c80fab
Přidáno uživatelem Václav Hrabík před více než 1 rok
src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/v2/controller/management/WorkUnitController.java | ||
---|---|---|
16 | 16 |
import org.springframework.web.bind.annotation.RequestBody; |
17 | 17 |
import org.springframework.web.bind.annotation.RequestMapping; |
18 | 18 |
|
19 |
import javax.annotation.Nullable; |
|
19 | 20 |
import javax.persistence.criteria.CriteriaBuilder; |
20 |
import java.util.Arrays; |
|
21 |
import java.util.List; |
|
22 |
import java.util.Map; |
|
21 |
import java.util.*; |
|
23 | 22 |
|
24 | 23 |
@RequestMapping("v2/management") |
25 | 24 |
@Controller |
src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/v2/service/workUnit/WorkUnitServiceV2Impl.java | ||
---|---|---|
6 | 6 |
import org.springframework.beans.factory.annotation.Autowired; |
7 | 7 |
import org.springframework.stereotype.Service; |
8 | 8 |
|
9 |
import java.util.HashSet; |
|
9 | 10 |
import java.util.List; |
11 |
import java.util.Set; |
|
10 | 12 |
|
11 | 13 |
@Service |
12 | 14 |
public class WorkUnitServiceV2Impl implements WorkUnitServiceV2 { |
... | ... | |
30 | 32 |
return updatedRows == wuCount; |
31 | 33 |
} |
32 | 34 |
|
35 |
@Override |
|
36 |
public Set<String> parseWorkUnitCategories(List<WorkUnit> workUnits) { |
|
37 |
Set<String> workUnitCategories = new HashSet<>(); |
|
38 |
for(WorkUnit unit : workUnits) { |
|
39 |
for(Category categ : unit.getCategories()) |
|
40 |
workUnitCategories.add(categ.getName()); |
|
41 |
} |
|
42 |
return workUnitCategories; |
|
43 |
} |
|
44 |
|
|
45 |
@Override |
|
46 |
public Set<String> parseWorkUnitTypes(List<WorkUnit> workUnits) { |
|
47 |
Set<String> workUnitTypes = new HashSet<>(); |
|
48 |
for(WorkUnit unit : workUnits) { |
|
49 |
workUnitTypes.add(unit.getType().getName()); |
|
50 |
} |
|
51 |
return workUnitTypes; |
|
52 |
} |
|
53 |
|
|
33 | 54 |
} |
Také k dispozici: Unified diff
https://kivprogrammers.atlassian.net/browse/TSP2-62 přidání filteru