Add UpdateGroupTitleEvent and UpdateGroupDescriptionEvent
This commit is contained in:
@ -2,6 +2,8 @@ package mops.gruppen2.entities;
|
|||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import mops.gruppen2.events.CreateGroupEvent;
|
import mops.gruppen2.events.CreateGroupEvent;
|
||||||
|
import mops.gruppen2.events.UpdateGroupDescriptionEvent;
|
||||||
|
import mops.gruppen2.events.UpdateGroupTitleEvent;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -18,4 +20,12 @@ public class Gruppe extends Aggregat {
|
|||||||
this.beschreibung = event.getBeschreibung();
|
this.beschreibung = event.getBeschreibung();
|
||||||
this.teilnehmersList= null;
|
this.teilnehmersList= null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void applyEvent(UpdateGroupTitleEvent event) {
|
||||||
|
this.titel = event.getTitel();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void applyEvent(UpdateGroupDescriptionEvent event) {
|
||||||
|
this.beschreibung = event.getBeschreibung();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,13 @@
|
|||||||
|
package mops.gruppen2.events;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
public class UpdateGroupDescriptionEvent extends Event {
|
||||||
|
String beschreibung;
|
||||||
|
|
||||||
|
public UpdateGroupDescriptionEvent(long id, long gruppe_id, long user_id, String beschreibung) {
|
||||||
|
super(id, gruppe_id, user_id);
|
||||||
|
this.beschreibung = beschreibung;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
package mops.gruppen2.events;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
public class UpdateGroupTitleEvent extends Event {
|
||||||
|
String titel;
|
||||||
|
|
||||||
|
public UpdateGroupTitleEvent(long id, long gruppe_id, long user_id, String titel) {
|
||||||
|
super(id, gruppe_id, user_id);
|
||||||
|
this.titel = titel;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user