added a default route
This commit is contained in:
@ -49,7 +49,7 @@ public class Gruppen2Controller {
|
||||
* @param model tolles model
|
||||
* @return index.html
|
||||
*/
|
||||
@RolesAllowed({"ROLE_orga", "ROLE_studentin", "ROLE_actuator)"})
|
||||
@RolesAllowed({"ROLE_orga", "ROLE_studentin", "ROLE_actuator"})
|
||||
@GetMapping("")
|
||||
public String index(KeycloakAuthenticationToken token, Model model) throws EventException {
|
||||
Account account = keyCloakService.createAccountFromPrincipal(token);
|
||||
@ -61,14 +61,14 @@ public class Gruppen2Controller {
|
||||
return "index";
|
||||
}
|
||||
|
||||
@RolesAllowed({"ROLE_orga", "ROLE_studentin", "ROLE_actuator)"})
|
||||
@RolesAllowed({"ROLE_orga", "ROLE_studentin", "ROLE_actuator"})
|
||||
@GetMapping("/createGroup")
|
||||
public String createGroup(KeycloakAuthenticationToken token, Model model) {
|
||||
model.addAttribute("account", keyCloakService.createAccountFromPrincipal(token));
|
||||
return "create";
|
||||
}
|
||||
|
||||
@RolesAllowed({"ROLE_orga", "ROLE_studentin", "ROLE_actuator)"})
|
||||
@RolesAllowed({"ROLE_orga", "ROLE_studentin", "ROLE_actuator"})
|
||||
@GetMapping("/findGroup")
|
||||
public String findGroup(KeycloakAuthenticationToken token, Model model, @RequestParam(value = "suchbegriff", required = false) String suchbegriff) throws EventException {
|
||||
List<Group> groupse = new ArrayList<>();
|
||||
@ -80,6 +80,7 @@ public class Gruppen2Controller {
|
||||
return "search";
|
||||
}
|
||||
|
||||
@RolesAllowed({"ROLE_orga", "ROLE_studentin", "ROLE_actuator"})
|
||||
@PostMapping("/createGroup")
|
||||
public String pCreateGroup(KeycloakAuthenticationToken token,
|
||||
@RequestParam(value = "title") String title,
|
||||
@ -93,7 +94,7 @@ public class Gruppen2Controller {
|
||||
return "redirect:/gruppen2/";
|
||||
}
|
||||
|
||||
@RolesAllowed({"ROLE_orga", "ROLE_studentin", "ROLE_actuator)"})
|
||||
@RolesAllowed({"ROLE_orga", "ROLE_studentin", "ROLE_actuator"})
|
||||
@GetMapping("/details")
|
||||
public String showGroupDetails(KeycloakAuthenticationToken token, Model model, @RequestParam(value = "id") Long id) throws EventException, ResponseStatusException {
|
||||
model.addAttribute("account", keyCloakService.createAccountFromPrincipal(token));
|
||||
@ -108,7 +109,7 @@ public class Gruppen2Controller {
|
||||
throw new ResponseStatusException(HttpStatus.NOT_FOUND, "Group not found");
|
||||
}
|
||||
|
||||
@RolesAllowed({"ROLE_orga", "ROLE_studentin", "ROLE_actuator)"})
|
||||
@RolesAllowed({"ROLE_orga", "ROLE_studentin", "ROLE_actuator"})
|
||||
@PostMapping("/detailsBeitreten")
|
||||
public String joinGroup(KeycloakAuthenticationToken token, Model model, @RequestParam(value = "id") Long id) throws EventException {
|
||||
model.addAttribute("account", keyCloakService.createAccountFromPrincipal(token));
|
||||
@ -117,7 +118,7 @@ public class Gruppen2Controller {
|
||||
return "redirect:/gruppen2/";
|
||||
}
|
||||
|
||||
@RolesAllowed({"ROLE_orga", "ROLE_studentin", "ROLE_actuator)"})
|
||||
@RolesAllowed({"ROLE_orga", "ROLE_studentin", "ROLE_actuator"})
|
||||
@GetMapping("/detailsSearch")
|
||||
public String showGroupDetailsNoMember(KeycloakAuthenticationToken token, Model model, @RequestParam(value = "id") Long id) throws EventException {
|
||||
model.addAttribute("account", keyCloakService.createAccountFromPrincipal(token));
|
||||
@ -129,7 +130,7 @@ public class Gruppen2Controller {
|
||||
throw new ResponseStatusException(HttpStatus.NOT_FOUND, "Group not found");
|
||||
}
|
||||
|
||||
@RolesAllowed({"ROLE_orga", "ROLE_studentin", "ROLE_actuator)"})
|
||||
@RolesAllowed({"ROLE_orga", "ROLE_studentin", "ROLE_actuator"})
|
||||
@GetMapping("/acceptinvite/{link}")
|
||||
public String acceptInvite(KeycloakAuthenticationToken token, Model model, @PathVariable String link) throws EventException {
|
||||
model.addAttribute("account", keyCloakService.createAccountFromPrincipal(token));
|
||||
@ -140,11 +141,17 @@ public class Gruppen2Controller {
|
||||
}
|
||||
throw new ResponseStatusException(HttpStatus.NOT_FOUND, "Group not found");
|
||||
}
|
||||
@RolesAllowed({"ROLE_orga", "ROLE_studentin", "ROLE_actuator)"})
|
||||
|
||||
@RolesAllowed({"ROLE_orga", "ROLE_studentin", "ROLE_actuator"})
|
||||
@PostMapping("/leaveGroup")
|
||||
public String pLeaveGroup(KeycloakAuthenticationToken token, @RequestParam(value = "group_id") Long id) {
|
||||
Account account = keyCloakService.createAccountFromPrincipal(token);
|
||||
controllerService.deleteUser(account, id);
|
||||
return "redirect:/gruppen2/";
|
||||
}
|
||||
|
||||
@GetMapping("*")
|
||||
public String defaultLink() {
|
||||
return "errorRenameLater";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user