Skip to content

Commit 219c83d

Browse files
authored
Merge pull request #50 from creatubbles/hotfix/missing-user-relations
Add missing custom style and school relations in User model
2 parents 6e30235 + 03f50ae commit 219c83d

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

api/src/main/java/com/creatubbles/api/model/user/User.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
import android.support.annotation.NonNull;
44
import android.support.annotation.Nullable;
55

6+
import com.creatubbles.api.model.school.School;
7+
import com.creatubbles.api.model.user.custom_style.CustomStyle;
68
import com.fasterxml.jackson.annotation.JsonCreator;
79
import com.fasterxml.jackson.annotation.JsonProperty;
810
import com.github.jasminb.jsonapi.annotations.Id;
11+
import com.github.jasminb.jsonapi.annotations.Relationship;
912
import com.github.jasminb.jsonapi.annotations.Type;
1013

1114
import java.util.Date;
@@ -89,6 +92,12 @@ public class User {
8992

9093
private String interests;
9194

95+
@Relationship("custom_style")
96+
private CustomStyle customStyle;
97+
98+
@Relationship("school")
99+
private School school;
100+
92101
public static User withId(String id) {
93102
return new User(id);
94103
}
@@ -268,6 +277,16 @@ public String getInterests() {
268277
return interests;
269278
}
270279

280+
@Nullable
281+
public School getSchool() {
282+
return school;
283+
}
284+
285+
@Nullable
286+
public CustomStyle getCustomStyle() {
287+
return customStyle;
288+
}
289+
271290
@Override
272291
public String toString() {
273292
return "User{" +
@@ -298,6 +317,8 @@ public String toString() {
298317
", homeSchooling=" + homeSchooling +
299318
", whatDoYouTeach='" + whatDoYouTeach + '\'' +
300319
", interests='" + interests + '\'' +
320+
", customStyle=" + customStyle +
321+
", school=" + school +
301322
'}';
302323
}
303324
}

api/src/main/java/com/creatubbles/api/model/user/custom_style/CustomStyle.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import java.util.Date;
1616
import java.util.List;
1717

18-
@Type("styles")
18+
@Type("custom_styles")
1919
public class CustomStyle {
2020

2121
@JsonCreator

0 commit comments

Comments
 (0)