Created
March 27, 2018 11:56
-
-
Save aindong/fe67610a0b8fe7c1ca3f6196900c61e0 to your computer and use it in GitHub Desktop.
Sample response
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@GET("/v1/categories") | |
void getMessages(Callback<BaseResponse<CategoriesResponse>> callback); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CategoriesResponse extends BaseResponse<List<Message>> { | |
@SerializedName("categories") List<Category> categories; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Category { | |
private String id; | |
private String name; | |
private String color; | |
private String icon; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BaseResponse<T> { | |
@SerializedName("data") public T data; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"data": [ | |
{ | |
"object": "Category", | |
"id": "zekYVdBgoA", | |
"name": "Spaghetti", | |
"color": "#00ff0c", | |
"icon": "http://192.168.1.127:8000/storage/icons/5aa787271dd44.png", | |
"created_at": { | |
"date": "2018-03-13 08:09:11.000000", | |
"timezone_type": 3, | |
"timezone": "UTC" | |
}, | |
"updated_at": { | |
"date": "2018-03-13 08:09:11.000000", | |
"timezone_type": 3, | |
"timezone": "UTC" | |
}, | |
"readable_created_at": "2 weeks ago", | |
"readable_updated_at": "2 weeks ago" | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment