Revert "add functionality for group_ids to User class"
This reverts commit 68789099
This commit is contained in:
@ -5,8 +5,6 @@ import lombok.Data;
|
|||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.Value;
|
import lombok.Value;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Value
|
@Value
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(exclude = {"givenname", "familyname", "email"})
|
@EqualsAndHashCode(exclude = {"givenname", "familyname", "email"})
|
||||||
@ -17,10 +15,4 @@ public class User {
|
|||||||
String givenname;
|
String givenname;
|
||||||
String familyname;
|
String familyname;
|
||||||
String email;
|
String email;
|
||||||
|
|
||||||
List<Long> group_ids;
|
|
||||||
|
|
||||||
public void addGroup(Long group_id){
|
|
||||||
group_ids.add(group_id);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,26 +0,0 @@
|
|||||||
package mops.gruppen2.service;
|
|
||||||
|
|
||||||
import mops.gruppen2.domain.User;
|
|
||||||
import mops.gruppen2.domain.event.Event;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class TeilnehmerService {
|
|
||||||
GroupService groupService;
|
|
||||||
EventService eventService;
|
|
||||||
|
|
||||||
public TeilnehmerService(GroupService groupService, EventService eventService){
|
|
||||||
this.eventService = eventService;
|
|
||||||
this.groupService = groupService;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void assignGroups(User user){
|
|
||||||
List<Event> events = eventService.findAllEvents();
|
|
||||||
|
|
||||||
for (Event event: events) {
|
|
||||||
if(user.getUser_id().equals(event.getUser_id())) user.addGroup(event.getGroup_id());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user