This commit is contained in:
2024-05-30 18:21:17 +02:00
parent c6deee3da7
commit 9070d1452b
2 changed files with 59 additions and 2 deletions

View File

@@ -6,6 +6,9 @@ import java.util.Vector;
import java.sql.*;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class JodelPost {
// id of the post
public Long id;
@@ -33,7 +36,7 @@ public class JodelPost {
// check if this is the first post in this process
if (idCache.isEmpty()) {
// create a new Vector as cache
idCache = Optional.of(new Vector());
idCache = Optional.of(new Vector<>());
}
// get the anonymized id as index in cached authorIDs
@@ -88,4 +91,16 @@ public class JodelPost {
public JodelPost(int authorID) {
this.authorID = (long) authorID;
}
}
@JsonCreator
public JodelPost(@JsonProperty("title") String title,
@JsonProperty("content") String content,
@JsonProperty("postdate") Timestamp date,
@JsonProperty("location") Location location) {
this.authorID = 10000L; // TODO: getter from Keycloak
this.title = title;
this.content = content;
this.date = date;
this.location = location;
}
}