added user reaction

This commit is contained in:
2024-06-11 12:41:14 +02:00
parent 018285c109
commit ded34c5f43
2 changed files with 9 additions and 7 deletions

View File

@@ -88,6 +88,7 @@ public class JodelPost {
this.content = rs.getString("content");
this.date = rs.getTimestamp("postdate");
this.location = new Location(rs.getFloat("longitude"), rs.getFloat("latitude"));
this.reaction = Optional.of(rs.getBoolean("reaction"));
this.reactions = new Reactions(rs.getLong("positive"), rs.getLong("negative"));
this.parent = Optional.of(rs.getLong("parent"));
}
@@ -102,10 +103,8 @@ public class JodelPost {
@JsonProperty("content") String content,
@JsonProperty("date") Timestamp date,
@JsonProperty("location") Location location,
@JsonProperty("parent") Optional<Long> parent,
// TODO: getter from Keycloak
@JsonProperty("authorID") long author) {
this.authorID = author; // TODO: getter from Keycloak
@JsonProperty("parent") Optional<Long> parent) {
this.authorID = User.getUserID(); // TODO: getter from Keycloak
this.title = title;
this.content = content;
this.date = date;