@@ -25,23 +25,25 @@ public class ApiResponse<T> {
2525 final private int statusCode ;
2626 final private Map <String , List <String >> headers ;
2727 final private T data ;
28+ final private String message ;
2829
2930 /**
3031 * @param statusCode The status code of HTTP response
3132 * @param headers The headers of HTTP response
3233 */
33- public ApiResponse (int statusCode , Map <String , List <String >> headers ) {
34- this (statusCode , headers , null );
34+ public ApiResponse (int statusCode , Map <String , List <String >> headers , String message ) {
35+ this (statusCode , headers , message , null );
3536 }
3637
3738 /**
3839 * @param statusCode The status code of HTTP response
3940 * @param headers The headers of HTTP response
4041 * @param data The object deserialized from response bod
4142 */
42- public ApiResponse (int statusCode , Map <String , List <String >> headers , T data ) {
43+ public ApiResponse (int statusCode , Map <String , List <String >> headers , String message , T data ) {
4344 this .statusCode = statusCode ;
4445 this .headers = headers ;
46+ this .message = message ;
4547 this .data = data ;
4648 }
4749
@@ -56,4 +58,8 @@ public Map<String, List<String>> getHeaders() {
5658 public T getData () {
5759 return data ;
5860 }
61+
62+ public String getMessage () {
63+ return message ;
64+ }
5965}
0 commit comments