Compare commits
No commits in common. "0bb2473b8a19f0cc43477dbc9c61250569211b073f9368375dcdd2a07cb52304" and "5e92048612a5c1af48cb544e90d6b7b9812ab8d5dfd641374b5836d2871a3bb6" have entirely different histories.
0bb2473b8a
...
5e92048612
@ -57,22 +57,30 @@ public class JsonResult<E> implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static JsonResult<String> success () {
|
public static JsonResult<String> success () {
|
||||||
return new JsonResult<>(Code.SUCCESS, Message.SUCCESS,null);
|
return new JsonResult<String>(Code.SUCCESS, Message.SUCCESS,null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static JsonResult<String> failed() {
|
public static JsonResult<String> failed() {
|
||||||
return new JsonResult<>(Code.FAILED, Message.FAILED,null);
|
return new JsonResult<String>(Code.FAILED, Message.FAILED,null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static JsonResult<String> failed(String msg) {
|
public static JsonResult<String> failed(String msg) {
|
||||||
return new JsonResult<>(Code.FAILED, msg,null);
|
return new JsonResult<String>(Code.FAILED, msg,null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static JsonResult<String> failed(Integer code,String msg) {
|
public static JsonResult<String> failed(Integer code,String msg) {
|
||||||
return new JsonResult<>(code, msg,null);
|
return new JsonResult<String>(code, msg,null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static JsonResult<Object> failed(String msg, Object data) {
|
public static JsonResult<Object> failed(String msg, Object data) {
|
||||||
return new JsonResult<>(Code.FAILED, msg, data);
|
return new JsonResult<>(Code.FAILED, msg, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isSuccess() {
|
||||||
|
return this.code == Code.SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isFailed() {
|
||||||
|
return this.code != Code.SUCCESS;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user