added Creating Groups to frontend and saving them in Database. Also prepared some Methods for Snapshot db
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
package mops.gruppen2.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.Value;
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.relational.core.mapping.Table;
|
||||
|
||||
@ -9,8 +8,8 @@ import org.springframework.data.relational.core.mapping.Table;
|
||||
@Data
|
||||
public class EventDTO {
|
||||
@Id
|
||||
long event_id;
|
||||
long group_id;
|
||||
Long event_id;
|
||||
Long group_id;
|
||||
String user_id;
|
||||
String event_payload;
|
||||
}
|
||||
|
||||
@ -16,14 +16,14 @@ public class AddUserEvent extends Event {
|
||||
String familyname;
|
||||
String email;
|
||||
|
||||
public AddUserEvent(long event_id, long group_id, String user_id, String givenname, String familyname, String email) {
|
||||
public AddUserEvent(Long event_id, Long group_id, String user_id, String givenname, String familyname, String email) {
|
||||
super(event_id, group_id, user_id);
|
||||
this.givenname = givenname;
|
||||
this.familyname = familyname;
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public AddUserEvent(long event_id, long group_id, User user) {
|
||||
public AddUserEvent(Long event_id, Long group_id, User user) {
|
||||
super(event_id, group_id, user.getUser_id());
|
||||
this.givenname = user.getGivenname();
|
||||
this.familyname = user.getFamilyname();
|
||||
|
||||
@ -11,9 +11,14 @@ public class CreateGroupEvent extends Event {
|
||||
String groupTitle;
|
||||
String groupDescription;
|
||||
|
||||
public CreateGroupEvent(long event_id, long group_id, String user_id, String groupTitle, String groupDescription) {
|
||||
public CreateGroupEvent(long event_id, Long group_id, String user_id, String groupTitle, String groupDescription) {
|
||||
super(event_id, group_id, user_id);
|
||||
this.groupTitle = groupTitle;
|
||||
this.groupDescription = groupDescription;
|
||||
}
|
||||
public CreateGroupEvent(Long group_id, String user_id, String groupTitle, String groupDescription) {
|
||||
super(group_id, user_id);
|
||||
this.groupTitle = groupTitle;
|
||||
this.groupDescription = groupDescription;
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,11 +6,9 @@ import lombok.*;
|
||||
* Entfernt ein einzelnes Mitglied einer Gruppe.
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class DeleteUserEvent extends Event {
|
||||
|
||||
public DeleteUserEvent(long event_id, long group_id, String user_id) {
|
||||
public DeleteUserEvent(Long event_id, Long group_id, String user_id) {
|
||||
super(event_id, group_id, user_id);
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,7 +24,12 @@ import lombok.NoArgsConstructor;
|
||||
@JsonSubTypes.Type(value = AddUserEvent.class, name = "UpdateRoleEvent"),
|
||||
})
|
||||
public class Event {
|
||||
long event_id;
|
||||
long group_id;
|
||||
Long event_id;
|
||||
Long group_id;
|
||||
String user_id;
|
||||
|
||||
public Event(Long group_id,String user_id){
|
||||
this.group_id = group_id;
|
||||
this.user_id = user_id;
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ import lombok.NoArgsConstructor;
|
||||
public class UpdateGroupDescriptionEvent extends Event {
|
||||
String newGroupDescription;
|
||||
|
||||
public UpdateGroupDescriptionEvent(long event_id, long group_id, String user_id, 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;
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ import lombok.NoArgsConstructor;
|
||||
public class UpdateGroupTitleEvent extends Event {
|
||||
String newGroupTitle;
|
||||
|
||||
public UpdateGroupTitleEvent(long event_id, long group_id, String user_id, 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;
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ public class UpdateRoleEvent extends Event {
|
||||
|
||||
Role newRole;
|
||||
|
||||
public UpdateRoleEvent(long event_id, long group_id, String user_id, Role newRole) {
|
||||
public UpdateRoleEvent(Long event_id, Long group_id, String user_id, Role newRole) {
|
||||
super(event_id, group_id, user_id);
|
||||
|
||||
this.newRole = newRole;
|
||||
|
||||
Reference in New Issue
Block a user