Merge remote-tracking branch 'origin/master' into showInviteLink
# Conflicts: # src/main/java/mops/gruppen2/controller/Gruppen2Controller.java # src/main/java/mops/gruppen2/controller/MopsController.java # src/main/java/mops/gruppen2/repository/InviteLinkRepository.java # src/main/java/mops/gruppen2/service/InviteLinkRepositoryService.java
This commit is contained in:
@ -7,6 +7,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Repräsentiert den aggregierten Zustand einer Gruppe.
|
||||
@ -17,13 +18,13 @@ public class Group {
|
||||
|
||||
private final List<User> members;
|
||||
private final Map<String, Role> roles;
|
||||
private Long id;
|
||||
private UUID id;
|
||||
private String title;
|
||||
private String description;
|
||||
private Long userMaximum;
|
||||
private GroupType type;
|
||||
private Visibility visibility;
|
||||
private Long parent;
|
||||
private UUID parent;
|
||||
|
||||
public Group() {
|
||||
this.members = new ArrayList<>();
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package mops.gruppen2.domain.api;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import mops.gruppen2.domain.Group;
|
||||
|
||||
import java.util.List;
|
||||
@ -9,6 +10,7 @@ import java.util.List;
|
||||
* Kombiniert den Status und die Gruppenliste zur ausgabe über die API.
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public class GroupRequestWrapper {
|
||||
|
||||
private final Long status;
|
||||
|
||||
@ -12,7 +12,7 @@ public class EventDTO {
|
||||
|
||||
@Id
|
||||
Long event_id;
|
||||
Long group_id;
|
||||
String group_id;
|
||||
String user_id;
|
||||
String event_type;
|
||||
String event_payload;
|
||||
|
||||
@ -12,6 +12,6 @@ public class InviteLinkDTO {
|
||||
|
||||
@Id
|
||||
Long link_id;
|
||||
Long group_id;
|
||||
String group_id;
|
||||
String invite_link;
|
||||
}
|
||||
|
||||
@ -10,6 +10,8 @@ import mops.gruppen2.domain.exception.EventException;
|
||||
import mops.gruppen2.domain.exception.GroupFullException;
|
||||
import mops.gruppen2.domain.exception.UserAlreadyExistsException;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Fügt einen einzelnen Nutzer einer Gruppe hinzu.
|
||||
*/
|
||||
@ -22,7 +24,7 @@ public class AddUserEvent extends Event {
|
||||
private String familyname;
|
||||
private String email;
|
||||
|
||||
public AddUserEvent(Long groupId, String userId, String givenname, String familyname, String email) {
|
||||
public AddUserEvent(UUID groupId, String userId, String givenname, String familyname, String email) {
|
||||
super(groupId, userId);
|
||||
this.givenname = givenname;
|
||||
this.familyname = familyname;
|
||||
|
||||
@ -7,17 +7,19 @@ import mops.gruppen2.domain.Group;
|
||||
import mops.gruppen2.domain.GroupType;
|
||||
import mops.gruppen2.domain.Visibility;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor // For Jackson
|
||||
public class CreateGroupEvent extends Event {
|
||||
|
||||
private Visibility groupVisibility;
|
||||
private Long groupParent;
|
||||
private UUID groupParent;
|
||||
private GroupType groupType;
|
||||
private Long groupUserMaximum;
|
||||
|
||||
public CreateGroupEvent(Long groupId, String userId, Long parent, GroupType type, Visibility visibility, Long userMaximum) {
|
||||
public CreateGroupEvent(UUID groupId, String userId, UUID parent, GroupType type, Visibility visibility, Long userMaximum) {
|
||||
super(groupId, userId);
|
||||
this.groupParent = parent;
|
||||
this.groupType = type;
|
||||
|
||||
@ -4,11 +4,13 @@ import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import mops.gruppen2.domain.Group;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@Getter
|
||||
@NoArgsConstructor // For Jackson
|
||||
public class DeleteGroupEvent extends Event {
|
||||
|
||||
public DeleteGroupEvent(Long groupId, String userId) {
|
||||
public DeleteGroupEvent(UUID groupId, String userId) {
|
||||
super(groupId, userId);
|
||||
}
|
||||
|
||||
|
||||
@ -7,6 +7,8 @@ import mops.gruppen2.domain.User;
|
||||
import mops.gruppen2.domain.exception.EventException;
|
||||
import mops.gruppen2.domain.exception.UserNotFoundException;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Entfernt ein einzelnes Mitglied einer Gruppe.
|
||||
*/
|
||||
@ -14,7 +16,7 @@ import mops.gruppen2.domain.exception.UserNotFoundException;
|
||||
@NoArgsConstructor // For Jackson
|
||||
public class DeleteUserEvent extends Event {
|
||||
|
||||
public DeleteUserEvent(Long groupId, String userId) {
|
||||
public DeleteUserEvent(UUID groupId, String userId) {
|
||||
super(groupId, userId);
|
||||
}
|
||||
|
||||
|
||||
@ -9,6 +9,8 @@ import mops.gruppen2.domain.Group;
|
||||
import mops.gruppen2.domain.exception.EventException;
|
||||
import mops.gruppen2.domain.exception.GroupIdMismatchException;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
||||
@JsonTypeInfo(
|
||||
use = JsonTypeInfo.Id.NAME,
|
||||
@ -29,7 +31,7 @@ import mops.gruppen2.domain.exception.GroupIdMismatchException;
|
||||
@AllArgsConstructor
|
||||
public abstract class Event {
|
||||
|
||||
protected Long groupId;
|
||||
protected UUID groupId;
|
||||
protected String userId;
|
||||
|
||||
public void apply(Group group) throws EventException {
|
||||
@ -39,7 +41,7 @@ public abstract class Event {
|
||||
|
||||
protected abstract void applyEvent(Group group) throws EventException;
|
||||
|
||||
private void checkGroupIdMatch(Long groupId) {
|
||||
private void checkGroupIdMatch(UUID groupId) {
|
||||
if (groupId == null || this.groupId.equals(groupId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -6,6 +6,8 @@ import lombok.NoArgsConstructor;
|
||||
import mops.gruppen2.domain.Group;
|
||||
import mops.gruppen2.domain.exception.NoValueException;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Ändert nur die Gruppenbeschreibung.
|
||||
*/
|
||||
@ -16,7 +18,7 @@ public class UpdateGroupDescriptionEvent extends Event {
|
||||
|
||||
private String newGroupDescription;
|
||||
|
||||
public UpdateGroupDescriptionEvent(Long groupId, String userId, String newGroupDescription) {
|
||||
public UpdateGroupDescriptionEvent(UUID groupId, String userId, String newGroupDescription) {
|
||||
super(groupId, userId);
|
||||
this.newGroupDescription = newGroupDescription;
|
||||
}
|
||||
|
||||
@ -6,6 +6,8 @@ import lombok.NoArgsConstructor;
|
||||
import mops.gruppen2.domain.Group;
|
||||
import mops.gruppen2.domain.exception.NoValueException;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Ändert nur den Gruppentitel.
|
||||
*/
|
||||
@ -16,7 +18,7 @@ public class UpdateGroupTitleEvent extends Event {
|
||||
|
||||
private String newGroupTitle;
|
||||
|
||||
public UpdateGroupTitleEvent(Long groupId, String userId, String newGroupTitle) {
|
||||
public UpdateGroupTitleEvent(UUID groupId, String userId, String newGroupTitle) {
|
||||
super(groupId, userId);
|
||||
this.newGroupTitle = newGroupTitle;
|
||||
}
|
||||
|
||||
@ -7,6 +7,8 @@ import mops.gruppen2.domain.Group;
|
||||
import mops.gruppen2.domain.Role;
|
||||
import mops.gruppen2.domain.exception.UserNotFoundException;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Aktualisiert die Gruppenrolle eines Teilnehmers.
|
||||
*/
|
||||
@ -17,7 +19,7 @@ public class UpdateRoleEvent extends Event {
|
||||
|
||||
private Role newRole;
|
||||
|
||||
public UpdateRoleEvent(Long groupId, String userId, Role newRole) {
|
||||
public UpdateRoleEvent(UUID groupId, String userId, Role newRole) {
|
||||
super(groupId, userId);
|
||||
this.newRole = newRole;
|
||||
}
|
||||
|
||||
@ -6,6 +6,8 @@ import lombok.NoArgsConstructor;
|
||||
import mops.gruppen2.domain.Group;
|
||||
import mops.gruppen2.domain.exception.EventException;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ -13,8 +15,8 @@ public class UpdateUserMaxEvent extends Event {
|
||||
|
||||
private Long userMaximum;
|
||||
|
||||
public UpdateUserMaxEvent(Long group_id, String user_id, Long userMaximum) {
|
||||
super(group_id,user_id);
|
||||
public UpdateUserMaxEvent(UUID group_id, String user_id, Long userMaximum) {
|
||||
super(group_id, user_id);
|
||||
this.userMaximum = userMaximum;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user