Added another repository method + test
This commit is contained in:
@ -56,15 +56,10 @@ public class GroupService {
|
||||
|
||||
public HashMap<Groups, Integer> getTakenPlaces(List<Groups> groups) {
|
||||
HashMap<Groups, Integer> respoonse = new HashMap<>();
|
||||
// groups.forEach(group -> {
|
||||
// final Long id = group.getId();
|
||||
// final Integer ammount =
|
||||
// this.repo.getAssignedAmount(id).orElse(Integer.valueOf(0)).intValue();
|
||||
// respoonse.put(group, ammount);
|
||||
// });
|
||||
|
||||
List<Object[]> respoonse2 = this.repo.getAssignedAmounts(
|
||||
groups.stream().filter(Objects::nonNull).map(Groups::getId).collect(Collectors.toList()));
|
||||
|
||||
return respoonse;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user