post dev
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user