1

Add CSV methods and createLecture.html

Co-Authored-By: tomvahl <tomvahl@users.noreply.github.com>
Co-Authored-By: andibuls <andibuls@users.noreply.github.com>
Co-Authored-By: Lukas Ettel <lukasettel@users.noreply.github.com>
This commit is contained in:
XXNitram
2020-03-18 13:36:57 +01:00
parent af573f2353
commit 051196f766
3 changed files with 73 additions and 8 deletions

View File

@ -7,10 +7,7 @@ import mops.gruppen2.domain.Exceptions.EventException;
import mops.gruppen2.domain.Group;
import mops.gruppen2.domain.apiWrapper.UpdatedGroupRequestMapper;
import mops.gruppen2.domain.event.Event;
import mops.gruppen2.service.APIFormatterService;
import mops.gruppen2.service.EventService;
import mops.gruppen2.service.GroupService;
import mops.gruppen2.service.SerializationService;
import mops.gruppen2.service.*;
import org.springframework.security.access.annotation.Secured;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

View File

@ -5,6 +5,7 @@ import mops.gruppen2.domain.Exceptions.EventException;
import mops.gruppen2.domain.Group;
import mops.gruppen2.domain.User;
import mops.gruppen2.domain.Visibility;
import mops.gruppen2.domain.event.CreateGroupEvent;
import mops.gruppen2.security.Account;
import mops.gruppen2.service.*;
@ -70,6 +71,17 @@ public class Gruppen2Controller {
return "createLecture";
}
@PostMapping("/createLecture")
public String pCreateLecture(KeycloakAuthenticationToken token,
@RequestParam(value = "title") String title,
@RequestParam(value = "beschreibung") String beschreibung) {
Account account = keyCloakService.createAccountFromPrincipal(token);
controllerService.createGroup(account, title, beschreibung, true);
return "redirect:/gruppen2/";
}
@RolesAllowed({"ROLE_orga", "ROLE_studentin", "ROLE_actuator)"})
@GetMapping("/createGroup")
public String createGroup(KeycloakAuthenticationToken token, Model model) {