1
Co-authored-by: Christoph <tobi@urpost.de>
This commit is contained in:
Christoph
2020-03-27 12:57:47 +01:00
parent cc64943663
commit 56a81ce66f
7 changed files with 26 additions and 25 deletions

View File

@ -5,6 +5,7 @@ import mops.gruppen2.domain.User;
import mops.gruppen2.domain.event.Event;
import mops.gruppen2.domain.exception.EventException;
import mops.gruppen2.domain.exception.GroupNotFoundException;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
@ -25,6 +26,7 @@ public class UserService {
//Test nötig??
@Cacheable("groups")
public List<Group> getUserGroups(User user) throws EventException {
List<UUID> groupIds = eventService.findGroupIdsByUser(user.getId());
List<Event> events = groupService.getGroupEvents(groupIds);
@ -41,6 +43,7 @@ public class UserService {
return newGroups;
}
@Cacheable("groups")
public List<Group> getUserGroups(String userId) throws EventException {
return getUserGroups(new User(userId, null, null, null));
}