reordered some variables in Post for easier JSON readability

This commit is contained in:
2024-06-13 15:01:27 +02:00
parent 57418213f5
commit df0db226a9
2 changed files with 5 additions and 5 deletions

View File

@@ -13,6 +13,8 @@ import com.fasterxml.jackson.annotation.JsonProperty;
public class JodelPost {
// id of the post
public Long id;
// Parent id
public Optional<Long> parent = Optional.empty();
// id of the author in db
private final Long authorID;
// anonymized authorID
@@ -25,14 +27,12 @@ public class JodelPost {
public Timestamp date;
// location if the post
public Location location;
// list of all comments for the post
public Vector<JodelPost> comments = new Vector<>();
// the own reaction (null = none, true = positive, false = negative)
public Optional<Boolean> reaction;
// all other reactions
public Reactions reactions;
// Parent id
public Optional<Long> parent = Optional.empty();
// list of all comments for the post
public Vector<JodelPost> comments = new Vector<>();
// anonymize function to recursively anonymize the posts
public void anonymize(Vector<Long> idCache) {

View File

@@ -4,8 +4,8 @@ import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class Location {
public float longitude;
public float latitude;
public float longitude;
@JsonCreator
public Location(@JsonProperty("longitude") float longitude, @JsonProperty("latitude") float latitude ) {