fixed post and added delete
This commit is contained in:
@@ -7,6 +7,7 @@ import java.util.Vector;
|
||||
import java.sql.*;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class JodelPost {
|
||||
@@ -30,6 +31,8 @@ public class JodelPost {
|
||||
public Optional<Boolean> reaction;
|
||||
// all other reactions
|
||||
public Reactions reactions;
|
||||
// Parent id
|
||||
public Optional<Long> parent = Optional.empty();
|
||||
|
||||
// anonymize function to recursively anonymize the posts
|
||||
public void anonymize(Optional<Vector<Long>> idCache) {
|
||||
@@ -95,12 +98,19 @@ public class JodelPost {
|
||||
@JsonCreator
|
||||
public JodelPost(@JsonProperty("title") String title,
|
||||
@JsonProperty("content") String content,
|
||||
@JsonProperty("postdate") Timestamp date,
|
||||
@JsonProperty("location") Location location) {
|
||||
@JsonProperty("date") Timestamp date,
|
||||
@JsonProperty("location") Location location,
|
||||
@JsonProperty("parent") Optional<Long> parent) {
|
||||
this.authorID = 10000L; // TODO: getter from Keycloak
|
||||
this.title = title;
|
||||
this.content = content;
|
||||
this.date = date;
|
||||
this.location = location;
|
||||
this.location = location;
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public long getAuthorID() {
|
||||
return authorID;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user