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

View File

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