1

new GroupCreationController mappings

This commit is contained in:
Christoph
2020-04-09 18:53:17 +02:00
parent e8649b0341
commit a964dbb8b6
12 changed files with 54 additions and 58 deletions

View File

@ -47,8 +47,8 @@ public class APIController {
@GetMapping("/update/{id}")
@Secured("ROLE_api_user")
@ApiOperation("Gibt veränderte Gruppen zurück")
public GroupRequestWrapper update(@ApiParam("Letzte gespeicherte EventId des Anfragestellers")
@PathVariable("id") long eventId) {
public GroupRequestWrapper getApiUpdate(@ApiParam("Letzte gespeicherte EventId des Anfragestellers")
@PathVariable("id") long eventId) {
return APIService.wrap(eventStoreService.findMaxEventId(),
projectionService.projectNewGroups(eventId));
@ -60,8 +60,8 @@ public class APIController {
@GetMapping("/usergroups/{id}")
@Secured("ROLE_api_user")
@ApiOperation("Gibt Gruppen zurück, in welchen ein Nutzer teilnimmt")
public List<String> usergroups(@ApiParam("Nutzer-Id")
@PathVariable("id") String userId) {
public List<String> getApiUserGroups(@ApiParam("Nutzer-Id")
@PathVariable("id") String userId) {
return IdService.uuidsToString(eventStoreService.findExistingUserGroups(new User(userId)));
}
@ -72,8 +72,8 @@ public class APIController {
@GetMapping("/group/{id}")
@Secured("ROLE_api_user")
@ApiOperation("Gibt die Gruppe mit der als Parameter mitgegebenden groupId zurück")
public Group getGroupById(@ApiParam("Gruppen-Id der gefordeten Gruppe")
@PathVariable("id") String groupId) {
public Group getApiGroup(@ApiParam("Gruppen-Id der gefordeten Gruppe")
@PathVariable("id") String groupId) {
return projectionService.projectSingleGroup(UUID.fromString(groupId));
}

View File

@ -41,19 +41,17 @@ public class GroupCreationController {
this.projectionService = projectionService;
}
//TODO: /create/orga
@RolesAllowed("ROLE_orga")
@GetMapping("/createOrga")
public String getCreateOrgaPage(Model model) {
@GetMapping("/create/orga")
public String getCreateOrga(Model model) {
model.addAttribute("lectures", projectionService.projectLectures());
return "createOrga";
}
//TODO: /create/orga
@RolesAllowed("ROLE_orga")
@PostMapping("/createOrga")
@PostMapping("/create/orga")
@CacheEvict(value = "groups", allEntries = true)
public String postCreateOrga(KeycloakAuthenticationToken token,
@RequestParam("title") String title,
@ -79,19 +77,17 @@ public class GroupCreationController {
return "redirect:/gruppen2/details/" + IdService.uuidToString(group.getId());
}
//TODO: /create/student
@RolesAllowed("ROLE_studentin")
@GetMapping("/createStudent")
public String getCreateStudentPage(Model model) {
@GetMapping("/create/student")
public String getCreateStudent(Model model) {
model.addAttribute("lectures", projectionService.projectLectures());
return "createStudent";
}
//TODO: /create/student
@RolesAllowed("ROLE_studentin")
@PostMapping("/createStudent")
@PostMapping("/create/student")
@CacheEvict(value = "groups", allEntries = true)
public String postCreateStudent(KeycloakAuthenticationToken token,
@RequestParam("title") String title,

View File

@ -24,10 +24,10 @@
<a href="/" th:href="@{/gruppen2}">Gruppen</a>
</li>
<li th:case="${true}">
<a href="/createOrga" th:href="@{/gruppen2/createOrga}">Erstellen</a>
<a href="/create/orga" th:href="@{/gruppen2/create/orga}">Erstellen</a>
</li>
<li th:case="${false}">
<a href="/createStudent" th:href="@{/gruppen2/createStudent}">Erstellen</a>
<a href="/create/student" th:href="@{/gruppen2/create/student}">Erstellen</a>
</li>
<li>
<a href="/searchPage" th:href="@{/gruppen2/searchPage}">Suche</a>

View File

@ -25,10 +25,10 @@
<a th:href="@{/gruppen2}" href="/">Gruppen</a>
</li>
<li th:case="${true}" class="active">
<a href="/createOrga" th:href="@{/gruppen2/createOrga}">Erstellen</a>
<a href="/create/orga" th:href="@{/gruppen2/create/orga}">Erstellen</a>
</li>
<li th:case="${false}" class="active">
<a href="/createStudent" th:href="@{/gruppen2/createStudent}">Erstellen</a>
<a href="/create/student" th:href="@{/gruppen2/create/student}">Erstellen</a>
</li>
<li>
<a th:href="@{/gruppen2/searchPage}" href="/searchPage">Suche</a>
@ -42,7 +42,7 @@
<div class="row">
<div class="col-10">
<h1>Gruppenerstellung</h1>
<form enctype="multipart/form-data" method="post" th:action="@{/gruppen2/createOrga}">
<form enctype="multipart/form-data" method="post" th:action="@{/gruppen2/create/orga}">
<div class="shadow-sm p-2" style=" border: 10px solid aliceblue; background: aliceblue;">
<div class="form-group">
<label for="titel">Titel</label>

View File

@ -21,10 +21,10 @@
<a th:href="@{/gruppen2}" href="/">Gruppen</a>
</li>
<li th:case="${true}" class="active">
<a href="/createOrga" th:href="@{/gruppen2/createOrga}">Erstellen</a>
<a href="/create/orga" th:href="@{/gruppen2/create/orga}">Erstellen</a>
</li>
<li th:case="${false}" class="active">
<a href="/createStudent" th:href="@{/gruppen2/createStudent}">Erstellen</a>
<a href="/create/student" th:href="@{/gruppen2/create/student}">Erstellen</a>
</li>
<li>
<a th:href="@{/gruppen2/searchPage}" href="/searchPage">Suche</a>
@ -37,7 +37,7 @@
<div class="row">
<div class="col-10">
<h1>Gruppenerstellung</h1>
<form method="post" th:action="@{/gruppen2/createStudent}">
<form method="post" th:action="@{/gruppen2/create/student}">
<div class="shadow-sm p-2"
style=" border: 10px solid aliceblue; border-radius: 5px; background: aliceblue;">

View File

@ -18,10 +18,10 @@
<a href="/" th:href="@{/gruppen2}">Gruppen</a>
</li>
<li th:case="${true}">
<a href="/createOrga" th:href="@{/gruppen2/createOrga}">Erstellen</a>
<a href="/create/orga" th:href="@{/gruppen2/create/orga}">Erstellen</a>
</li>
<li th:case="${false}">
<a href="/createStudent" th:href="@{/gruppen2/createStudent}">Erstellen</a>
<a href="/create/student" th:href="@{/gruppen2/create/student}">Erstellen</a>
</li>
<li>
<a href="/searchPage" th:href="@{/gruppen2/searchPage}">Suche</a>

View File

@ -16,10 +16,10 @@
<a th:href="@{/gruppen2}" href="/">Gruppen</a>
</li>
<li th:case="${true}">
<a href="/createOrga" th:href="@{/gruppen2/createOrga}">Erstellen</a>
<a href="/create/orga" th:href="@{/gruppen2/create/orga}">Erstellen</a>
</li>
<li th:case="${false}">
<a href="/createStudent" th:href="@{/gruppen2/createStudent}">Erstellen</a>
<a href="/create/student" th:href="@{/gruppen2/create/student}">Erstellen</a>
</li>
<li class="active">
<a th:href="@{/gruppen2/searchPage}" href="/searchPage">Suche</a>

View File

@ -21,10 +21,10 @@
<a th:href="@{/gruppen2}" href="/">Gruppen</a>
</li>
<li th:case="${true}">
<a href="/createOrga" th:href="@{/gruppen2/createOrga}">Erstellen</a>
<a href="/create/orga" th:href="@{/gruppen2/create/orga}">Erstellen</a>
</li>
<li th:case="${false}">
<a href="/createStudent" th:href="@{/gruppen2/createStudent}">Erstellen</a>
<a href="/create/student" th:href="@{/gruppen2/create/student}">Erstellen</a>
</li>
<li>
<a th:href="@{/gruppen2/searchPage}" href="/searchPage">Suche</a>

View File

@ -17,10 +17,10 @@
<a href="/" th:href="@{/gruppen2}">Gruppen</a>
</li>
<li th:case="${true}">
<a href="/createOrga" th:href="@{/gruppen2/createOrga}">Erstellen</a>
<a href="/create/orga" th:href="@{/gruppen2/create/orga}">Erstellen</a>
</li>
<li th:case="${false}">
<a href="/createStudent" th:href="@{/gruppen2/createStudent}">Erstellen</a>
<a href="/create/student" th:href="@{/gruppen2/create/student}">Erstellen</a>
</li>
<li>
<a href="/searchPage" th:href="@{/gruppen2/searchPage}">Suche</a>

View File

@ -19,10 +19,10 @@
<a href="/" th:href="@{/gruppen2}">Gruppen</a>
</li>
<li th:case="${true}">
<a href="/createOrga" th:href="@{/gruppen2/createOrga}">Erstellen</a>
<a href="/create/orga" th:href="@{/gruppen2/create/orga}">Erstellen</a>
</li>
<li th:case="${false}">
<a href="/createStudent" th:href="@{/gruppen2/createStudent}">Erstellen</a>
<a href="/create/student" th:href="@{/gruppen2/create/student}">Erstellen</a>
</li>
<li class="active">
<a href="/searchPage" th:href="@{/gruppen2/searchPage}">Suche</a>

View File

@ -17,10 +17,10 @@
<a th:href="@{/gruppen2}" href="/">Gruppen</a>
</li>
<li th:case="${true}">
<a href="/createOrga" th:href="@{/gruppen2/createOrga}">Erstellen</a>
<a href="/create/orga" th:href="@{/gruppen2/create/orga}">Erstellen</a>
</li>
<li th:case="${false}">
<a href="/createStudent" th:href="@{/gruppen2/createStudent}">Erstellen</a>
<a href="/create/student" th:href="@{/gruppen2/create/student}">Erstellen</a>
</li>
<li class="active">
<a th:href="@{/gruppen2/searchPage}" href="/searchPage">Suche</a>