Compare commits
No commits in common. "12fce27d04f59bde80d85ee7106773ea68eb9bae" and "c754b77c81349779965d835a2be176f81bfd48ef" have entirely different histories.
12fce27d04
...
c754b77c81
@ -16,12 +16,11 @@ public class DataController {
|
|||||||
|
|
||||||
public static long USER_ID = -1;
|
public static long USER_ID = -1;
|
||||||
|
|
||||||
private static final String ALL_EVENTS_ENDPOINT = "http://localhost:8080/event/all";
|
private static final String ALL_EVENTS_ENDPOINT = "http://localhost:8080/vpr/all-events";
|
||||||
private static final String ADD_EVENT_ENDPOINT = "http://localhost:8080/event/add";
|
private static final String ALL_USERS_ENDPOINT = "http://localhost:8080/vpr/all-users";
|
||||||
private static final String DELETE_EVENT_ENDPOINT = "http://localhost:8080/event/del";
|
private static final String ADD_EVENT_ENDPOINT = "http://localhost:8080/vpr/add-event";
|
||||||
|
private static final String DELETE_EVENT_ENDPOINT = "http://localhost:8080/vpr/del-event";
|
||||||
private static final String LOGIN_ENDPOINT = "http://localhost:8080/user/login";
|
private static final String LOGIN_ENDPOINT = "http://localhost:8080/vpr/login";
|
||||||
private static final String ALL_USERS_ENDPOINT = "http://localhost:8080/user/all";
|
|
||||||
|
|
||||||
private final HttpRequest httpRequest;
|
private final HttpRequest httpRequest;
|
||||||
|
|
||||||
@ -111,4 +110,4 @@ public class DataController {
|
|||||||
|
|
||||||
return objectMapper.readValue(jsonString, Event[].class);
|
return objectMapper.readValue(jsonString, Event[].class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,20 +66,21 @@ public class Event {
|
|||||||
String end,
|
String end,
|
||||||
LocalDateTime date,
|
LocalDateTime date,
|
||||||
int ownerId
|
int ownerId
|
||||||
) throws IllegalArgumentException{
|
) throws IllegalArgumentException {
|
||||||
if(name.length() < 3){
|
if (name.length() < 3) {
|
||||||
throw new IllegalArgumentException("Der Name muss eine L\u00e4nge von 3 haben.");
|
throw new IllegalArgumentException("Der Name muss eine L\u00e4nge von 3 haben.");
|
||||||
}
|
}
|
||||||
Pattern pattern = Pattern.compile("[A-Za-zÄÖÜäöü0-9 =!?+*/$%€.:,;_<>()-]*");
|
Pattern pattern = Pattern.compile("[A-Za-zÄÖÜäöü0-9 =!?+*/$%€.:,;_<>()-]*");
|
||||||
Matcher matcher = pattern.matcher(name);
|
Matcher matcher = pattern.matcher(name);
|
||||||
if(!matcher.matches()){
|
if (!matcher.matches()) {
|
||||||
throw new IllegalArgumentException("Der Name darf nur aus Zahlen, Buchstaben und folgenden Sonderzeichen bestehen: =!?+*/$%€.:,;_ <>()-");
|
throw new IllegalArgumentException("Der Name Darf nur aus Zahlen, Buchstaben und " +
|
||||||
|
"folgenden Sonderzeichen bestehen: =!?+*/$%€.:,;_ <>()-");
|
||||||
}
|
}
|
||||||
if(priority < 0){
|
if (priority < 0) {
|
||||||
throw new IllegalArgumentException("Bitte eine Priorit\u00e4t w\u00e4hlen.");
|
throw new IllegalArgumentException("Bitte eine Priorit\u00e4t w\u00e4hlen.");
|
||||||
}
|
}
|
||||||
LocalDateTime today = LocalDateTime.now().toLocalDate().atStartOfDay();
|
LocalDateTime today = LocalDateTime.now().toLocalDate().atStartOfDay();
|
||||||
if(Duration.between(today, date).isNegative()){
|
if (Duration.between(today, date).isNegative()) {
|
||||||
throw new IllegalArgumentException("Das Datum muss in der Zukunft liegen.");
|
throw new IllegalArgumentException("Das Datum muss in der Zukunft liegen.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user