Merge remote-tracking branch 'origin/change-to-polymorphie' into change-to-polymorphie
This commit is contained in:
@ -43,14 +43,6 @@ public class Group {
|
||||
}
|
||||
}
|
||||
|
||||
private void applyEvent(UpdateGroupTitleEvent event) {
|
||||
this.title = event.getNewGroupTitle();
|
||||
}
|
||||
|
||||
private void applyEvent(UpdateGroupDescriptionEvent event) {
|
||||
this.description = event.getNewGroupDescription();
|
||||
}
|
||||
|
||||
private void applyEvent(DeleteUserEvent event) throws UserNotFoundException {
|
||||
User user = new User(event.getUser_id(), "", "", "");
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@ package mops.gruppen2.domain.event;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import mops.gruppen2.domain.Group;
|
||||
|
||||
/**
|
||||
* Ändert nur die Gruppenbeschreibung.
|
||||
@ -13,13 +14,12 @@ import lombok.NoArgsConstructor;
|
||||
public class UpdateGroupDescriptionEvent extends Event {
|
||||
String newGroupDescription;
|
||||
|
||||
public UpdateGroupDescriptionEvent(Long event_id, Long group_id, String user_id, String newGroupDescription) {
|
||||
super(event_id, group_id, user_id);
|
||||
this.newGroupDescription = newGroupDescription;
|
||||
}
|
||||
|
||||
public UpdateGroupDescriptionEvent(Long group_id, String user_id, String newGroupDescription) {
|
||||
super(group_id, user_id);
|
||||
this.newGroupDescription = newGroupDescription;
|
||||
}
|
||||
|
||||
public void apply(Group group) {
|
||||
group.setDescription(this.newGroupDescription);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package mops.gruppen2.domain.event;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import mops.gruppen2.domain.Group;
|
||||
|
||||
/**
|
||||
* Ändert nur den Gruppentitel.
|
||||
@ -13,13 +14,13 @@ import lombok.NoArgsConstructor;
|
||||
public class UpdateGroupTitleEvent extends Event {
|
||||
String newGroupTitle;
|
||||
|
||||
public UpdateGroupTitleEvent(Long event_id, Long group_id, String user_id, String newGroupTitle) {
|
||||
super(event_id, group_id, user_id);
|
||||
this.newGroupTitle = newGroupTitle;
|
||||
}
|
||||
|
||||
public UpdateGroupTitleEvent(Long group_id, String user_id, String newGroupTitle) {
|
||||
super(group_id, user_id);
|
||||
this.newGroupTitle = newGroupTitle;
|
||||
}
|
||||
|
||||
public void apply(Group group) {
|
||||
group.setTitle(this.newGroupTitle);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user