aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsowgro <tpoke.ferrari@gmail.com>2025-02-16 15:53:52 -0500
committersowgro <tpoke.ferrari@gmail.com>2025-02-16 15:53:52 -0500
commitb25ec2813c14d21824e8d1af78ac478b35bac8bc (patch)
treeefb567ceb3139430ce1f16911ded49b95a09135f
parentc107ee3b8013e4e4c7308788bff9d44b419ce74b (diff)
downloadJellySolutions-b25ec2813c14d21824e8d1af78ac478b35bac8bc.tar.gz
JellySolutions-b25ec2813c14d21824e8d1af78ac478b35bac8bc.tar.bz2
JellySolutions-b25ec2813c14d21824e8d1af78ac478b35bac8bc.zip
Add jsonProperty decorations
-rw-r--r--ufund-api/data/cupboard.json2
-rw-r--r--ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java16
2 files changed, 10 insertions, 8 deletions
diff --git a/ufund-api/data/cupboard.json b/ufund-api/data/cupboard.json
index 0637a08..4be246d 100644
--- a/ufund-api/data/cupboard.json
+++ b/ufund-api/data/cupboard.json
@@ -1 +1 @@
-[] \ No newline at end of file
+[{"name":"Test","id":1,"maxGoal":100.0,"type":"PHYSICAL","filterAttributes":null,"Current":0.0}] \ No newline at end of file
diff --git a/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java b/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java
index 9187796..2611357 100644
--- a/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java
+++ b/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java
@@ -1,5 +1,7 @@
package com.ufund.api.ufundapi.model;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
public class Need {
public enum GoalType {
@@ -7,12 +9,12 @@ public class Need {
PHYSICAL
}
- private String name;
- private int id;
- private String[] filterAttributes;
- final private GoalType type;
- private double maxGoal;
- private double current;
+ @JsonProperty("name") private String name;
+ @JsonProperty("id") private int id;
+ @JsonProperty("filterAttributes") private String[] filterAttributes;
+ @JsonProperty("type") final private GoalType type;
+ @JsonProperty("maxGoal") private double maxGoal;
+ @JsonProperty("Current") private double current;
/**
* Create a new need
@@ -22,7 +24,7 @@ public class Need {
* @param maxGoal The maximum goal for this need
* @param type The type of need (monetary, physical)
*/
- public Need(String name, int id, double maxGoal, GoalType type) {
+ public Need(@JsonProperty("name") String name, @JsonProperty("id") int id, @JsonProperty("maxGoal") double maxGoal, GoalType type) {
this.id = id;
this.name = name;
this.maxGoal = maxGoal;