Functionality done

This commit is contained in:
BuildTools
2020-10-29 16:25:55 +01:00
parent d3a2256334
commit 3a3e6dc427
4 changed files with 35 additions and 4 deletions

View File

@ -41,4 +41,15 @@ public class GroupService {
public Optional<Groups> getGroupById(Long id) {
return this.repo.findById(id);
}
public Long findNotExistingGroup(List<Long> ids) {
Long response = Long.MIN_VALUE;
for (Long oneId : ids) {
if (this.repo.existsById(oneId) == false) {
response = oneId;
}
}
return response;
}
}

View File

@ -49,4 +49,8 @@ public class UserService {
return this.repo.searchForUsers(query, UserRoles.STUDENT);
}
public Optional<User> getById(Long userId) {
return this.repo.findById(userId);
}
}