diff --git a/src/main/java/mops/gruppen2/controller/APIController.java b/src/main/java/mops/gruppen2/controller/APIController.java index 0963fbd..8024114 100644 --- a/src/main/java/mops/gruppen2/controller/APIController.java +++ b/src/main/java/mops/gruppen2/controller/APIController.java @@ -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; diff --git a/src/main/java/mops/gruppen2/controller/Gruppen2Controller.java b/src/main/java/mops/gruppen2/controller/Gruppen2Controller.java index 27ca179..f3ce681 100644 --- a/src/main/java/mops/gruppen2/controller/Gruppen2Controller.java +++ b/src/main/java/mops/gruppen2/controller/Gruppen2Controller.java @@ -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) { diff --git a/src/main/resources/templates/createLecture.html b/src/main/resources/templates/createLecture.html index 566549b..88ff3c9 100644 --- a/src/main/resources/templates/createLecture.html +++ b/src/main/resources/templates/createLecture.html @@ -1,10 +1,66 @@ - + - - Title + + Gruppenerstellung + + + - +
+ +
+
+
+
+
+

Veranstaltung erstellen

+
+
+
+ + +
+
+ + +
+
+
+
+
+ + +
+
+
+
+
+ +
+
+
+
+
+
+
\ No newline at end of file