Merge branch 'master' into invite-link-group-id-change
# Conflicts: # src/main/java/mops/gruppen2/controller/Gruppen2Controller.java # src/main/java/mops/gruppen2/service/ControllerService.java
This commit is contained in:
@ -47,7 +47,7 @@ public class ControllerService {
|
||||
* @param title Gruppentitel
|
||||
* @param description Gruppenbeschreibung
|
||||
*/
|
||||
public void createGroup(Account account, String title, String description, Boolean visibility, Long userMaximum, UUID parent) throws EventException {
|
||||
public void createGroup(Account account, String title, String description, Boolean maxInfiniteUsers, Boolean visibility, Long userMaximum, UUID parent) throws EventException {
|
||||
Visibility visibility1;
|
||||
UUID groupId = eventService.checkGroup();
|
||||
|
||||
@ -57,6 +57,10 @@ public class ControllerService {
|
||||
visibility1 = Visibility.PRIVATE;
|
||||
}
|
||||
|
||||
if(maxInfiniteUsers){
|
||||
userMaximum = 100000L;
|
||||
}
|
||||
|
||||
CreateGroupEvent createGroupEvent = new CreateGroupEvent(groupId, account.getName(), parent, GroupType.SIMPLE, visibility1, userMaximum);
|
||||
eventService.saveEvent(createGroupEvent);
|
||||
|
||||
@ -66,7 +70,7 @@ public class ControllerService {
|
||||
updateRole(account.getName(), groupId);
|
||||
}
|
||||
|
||||
public void createOrga(Account account, String title, String description, Boolean visibility, Boolean lecture, Long userMaximum, UUID parent, List<User> users) throws EventException {
|
||||
public void createOrga(Account account, String title, String description, Boolean visibility, Boolean lecture, Boolean maxInfiniteUsers, Long userMaximum, UUID parent, List<User> users) throws EventException {
|
||||
Visibility visibility1;
|
||||
UUID groupId = eventService.checkGroup();
|
||||
|
||||
@ -83,6 +87,11 @@ public class ControllerService {
|
||||
groupType = GroupType.SIMPLE;
|
||||
}
|
||||
|
||||
|
||||
if(maxInfiniteUsers){
|
||||
userMaximum = 100000L;
|
||||
}
|
||||
|
||||
CreateGroupEvent createGroupEvent = new CreateGroupEvent(groupId, account.getName(), parent, groupType, visibility1, userMaximum);
|
||||
eventService.saveEvent(createGroupEvent);
|
||||
|
||||
@ -121,6 +130,11 @@ public class ControllerService {
|
||||
eventService.saveEvent(updateGroupDescriptionEvent);
|
||||
}
|
||||
|
||||
public void updateMaxUser(Account account, Long groupId, Long userMaximum) {
|
||||
UpdateUserMaxEvent updateUserMaxEvent = new UpdateUserMaxEvent(groupId,account.getName(),userMaximum);
|
||||
eventService.saveEvent(updateUserMaxEvent);
|
||||
}
|
||||
|
||||
public void updateRole(String userId, UUID groupId) throws EventException {
|
||||
UpdateRoleEvent updateRoleEvent;
|
||||
Group group = userService.getGroupById(groupId);
|
||||
|
||||
Reference in New Issue
Block a user