fix api etc
This commit is contained in:
@ -100,7 +100,7 @@ public class Gruppen2Controller {
|
|||||||
try {
|
try {
|
||||||
userList = CsvService.read(file.getInputStream());
|
userList = CsvService.read(file.getInputStream());
|
||||||
if(userList.size() > userMaximum){
|
if(userList.size() > userMaximum){
|
||||||
userMaximum = Long.valueOf(userList.size()) + userMaximum;
|
userMaximum = Long.valueOf(userList.size()) + userMaximum;
|
||||||
}
|
}
|
||||||
} catch (UnrecognizedPropertyException | CharConversionException ex) {
|
} catch (UnrecognizedPropertyException | CharConversionException ex) {
|
||||||
logger.warning("File konnte nicht gelesen werden");
|
logger.warning("File konnte nicht gelesen werden");
|
||||||
@ -110,7 +110,9 @@ public class Gruppen2Controller {
|
|||||||
visibility = visibility == null;
|
visibility = visibility == null;
|
||||||
lecture = lecture != null;
|
lecture = lecture != null;
|
||||||
|
|
||||||
if (lecture) parent = null;
|
if (lecture || parent == null) {
|
||||||
|
parent = "00000000-0000-0000-0000-000000000000";
|
||||||
|
}
|
||||||
|
|
||||||
controllerService.createOrga(account, title, description, visibility, lecture, userMaximum, UUID.fromString(parent), userList);
|
controllerService.createOrga(account, title, description, visibility, lecture, userMaximum, UUID.fromString(parent), userList);
|
||||||
|
|
||||||
@ -178,6 +180,7 @@ public class Gruppen2Controller {
|
|||||||
Group group = userService.getGroupById(UUID.fromString(groupId));
|
Group group = userService.getGroupById(UUID.fromString(groupId));
|
||||||
Account account = keyCloakService.createAccountFromPrincipal(token);
|
Account account = keyCloakService.createAccountFromPrincipal(token);
|
||||||
User user = new User(account.getName(), account.getGivenname(), account.getFamilyname(), account.getEmail());
|
User user = new User(account.getName(), account.getGivenname(), account.getFamilyname(), account.getEmail());
|
||||||
|
|
||||||
UUID parentId = group.getParent();
|
UUID parentId = group.getParent();
|
||||||
Group parent = new Group();
|
Group parent = new Group();
|
||||||
if (group.getTitle() == null) {
|
if (group.getTitle() == null) {
|
||||||
@ -195,7 +198,7 @@ public class Gruppen2Controller {
|
|||||||
}
|
}
|
||||||
return "detailsNoMember";
|
return "detailsNoMember";
|
||||||
}
|
}
|
||||||
if (parentId != null) {
|
if (parentId != null && !parentId.equals(UUID.fromString("00000000-0000-0000-0000-000000000000"))) {
|
||||||
parent = userService.getGroupById(parentId);
|
parent = userService.getGroupById(parentId);
|
||||||
}
|
}
|
||||||
if (group != null) {
|
if (group != null) {
|
||||||
@ -250,13 +253,13 @@ public class Gruppen2Controller {
|
|||||||
|
|
||||||
@RolesAllowed({"ROLE_orga", "ROLE_studentin", "ROLE_actuator"})
|
@RolesAllowed({"ROLE_orga", "ROLE_studentin", "ROLE_actuator"})
|
||||||
@GetMapping("/acceptinvite/{link}")
|
@GetMapping("/acceptinvite/{link}")
|
||||||
public String acceptInvite(KeycloakAuthenticationToken token, Model model, @PathVariable String link) throws EventException {
|
public String acceptInvite(KeycloakAuthenticationToken token, Model model, @PathVariable String groupId) throws EventException {
|
||||||
model.addAttribute("account", keyCloakService.createAccountFromPrincipal(token));
|
model.addAttribute("account", keyCloakService.createAccountFromPrincipal(token));
|
||||||
/*Group group = userService.getGroupById(inviteLinkRepositoryService.findGroupIdByInvite(link));
|
Group group = userService.getGroupById(UUID.fromString(groupId));
|
||||||
if (group != null) {
|
if (group != null) {
|
||||||
model.addAttribute("group", group);
|
model.addAttribute("group", group);
|
||||||
return "redirect:/gruppen2/detailsSearch?id=" + group.getId();
|
return "redirect:/gruppen2/detailsSearch?id=" + group.getId();
|
||||||
}*/
|
}
|
||||||
throw new GroupNotFoundException(this.getClass().toString());
|
throw new GroupNotFoundException(this.getClass().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -17,10 +17,10 @@ public class MopsController {
|
|||||||
public String logout(HttpServletRequest request) throws Exception {
|
public String logout(HttpServletRequest request) throws Exception {
|
||||||
request.logout();
|
request.logout();
|
||||||
return "redirect:/gruppen2/";
|
return "redirect:/gruppen2/";
|
||||||
}
|
}/*
|
||||||
|
|
||||||
@GetMapping("*")
|
@GetMapping("*")
|
||||||
public String defaultLink() {
|
public String defaultLink() {
|
||||||
return "error";
|
return "error";
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package mops.gruppen2.domain.api;
|
package mops.gruppen2.domain.api;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
import mops.gruppen2.domain.Group;
|
import mops.gruppen2.domain.Group;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -9,6 +10,7 @@ import java.util.List;
|
|||||||
* Kombiniert den Status und die Gruppenliste zur ausgabe über die API.
|
* Kombiniert den Status und die Gruppenliste zur ausgabe über die API.
|
||||||
*/
|
*/
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
@Getter
|
||||||
public class GroupRequestWrapper {
|
public class GroupRequestWrapper {
|
||||||
|
|
||||||
private final Long status;
|
private final Long status;
|
||||||
|
|||||||
Reference in New Issue
Block a user