added reaction endpoint

This commit is contained in:
2024-06-12 11:59:48 +02:00
parent 5a74e1cb5b
commit 370912a091
3 changed files with 66 additions and 7 deletions

View File

@@ -83,7 +83,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.reaction = rs.getString("reaction") == null ? Optional.empty() : Optional.of(rs.getBoolean("reaction"));
this.reactions = new Reactions(rs.getLong("positive"), rs.getLong("negative"));
this.parent = Optional.of(rs.getLong("parent"));
}
@@ -99,7 +99,7 @@ public class JodelPost {
@JsonProperty("date") Timestamp date,
@JsonProperty("location") Location location,
@JsonProperty("parent") Optional<Long> parent) {
this.authorID = User.getUserID(); // TODO: getter from Keycloak
this.authorID = User.getID(); // TODO: getter from Keycloak
this.title = title;
this.content = content;
this.date = date;