@ -5,13 +5,7 @@ import mops.gruppen2.domain.GroupType;
|
||||
import mops.gruppen2.domain.Role;
|
||||
import mops.gruppen2.domain.User;
|
||||
import mops.gruppen2.domain.Visibility;
|
||||
import mops.gruppen2.domain.event.AddUserEvent;
|
||||
import mops.gruppen2.domain.event.CreateGroupEvent;
|
||||
import mops.gruppen2.domain.event.DeleteGroupEvent;
|
||||
import mops.gruppen2.domain.event.DeleteUserEvent;
|
||||
import mops.gruppen2.domain.event.UpdateGroupDescriptionEvent;
|
||||
import mops.gruppen2.domain.event.UpdateGroupTitleEvent;
|
||||
import mops.gruppen2.domain.event.UpdateRoleEvent;
|
||||
import mops.gruppen2.domain.event.*;
|
||||
import mops.gruppen2.domain.exception.EventException;
|
||||
import mops.gruppen2.domain.exception.UserNotFoundException;
|
||||
import mops.gruppen2.security.Account;
|
||||
@ -49,7 +43,7 @@ public class ControllerService {
|
||||
* @param title Gruppentitel
|
||||
* @param description Gruppenbeschreibung
|
||||
*/
|
||||
public void createGroup(Account account, String title, String description, Boolean visibility, Long userMaximum, Long parent) throws EventException {
|
||||
public void createGroup(Account account, String title, String description, Boolean visibility, Boolean maxInfiniteUsers, Long userMaximum, Long parent) throws EventException {
|
||||
Visibility visibility1;
|
||||
Long groupId = eventService.checkGroup();
|
||||
|
||||
@ -60,6 +54,10 @@ public class ControllerService {
|
||||
createInviteLink(groupId);
|
||||
}
|
||||
|
||||
if(maxInfiniteUsers){
|
||||
userMaximum = 100000L;
|
||||
}
|
||||
|
||||
CreateGroupEvent createGroupEvent = new CreateGroupEvent(groupId, account.getName(), parent, GroupType.SIMPLE, visibility1, userMaximum);
|
||||
eventService.saveEvent(createGroupEvent);
|
||||
|
||||
@ -69,7 +67,7 @@ public class ControllerService {
|
||||
updateRole(account.getName(), groupId);
|
||||
}
|
||||
|
||||
public void createOrga(Account account, String title, String description, Boolean visibility, Boolean lecture, Long userMaximum, Long parent, List<User> users) throws EventException {
|
||||
public void createOrga(Account account, String title, String description, Boolean visibility, Boolean lecture, Boolean maxInfiniteUsers, Long userMaximum, Long parent, List<User> users) throws EventException {
|
||||
Visibility visibility1;
|
||||
Long groupId = eventService.checkGroup();
|
||||
|
||||
@ -86,6 +84,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);
|
||||
|
||||
@ -128,6 +131,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, Long groupId) throws EventException {
|
||||
UpdateRoleEvent updateRoleEvent;
|
||||
Group group = userService.getGroupById(groupId);
|
||||
|
||||
Reference in New Issue
Block a user