diff options
Diffstat (limited to 'ufund-api')
| -rw-r--r-- | ufund-api/data/cupboard.json | 2 | ||||
| -rw-r--r-- | ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java | 16 | 
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;  | 
