结果修改
This commit is contained in:
parent
69bbac2024
commit
e9f8b12dc5
@ -57,30 +57,22 @@ public class JsonResult<E> implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static JsonResult<String> success () {
|
public static JsonResult<String> success () {
|
||||||
return new JsonResult<String>(Code.SUCCESS, Message.SUCCESS,null);
|
return new JsonResult<>(Code.SUCCESS, Message.SUCCESS,null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static JsonResult<String> failed() {
|
public static JsonResult<String> failed() {
|
||||||
return new JsonResult<String>(Code.FAILED, Message.FAILED,null);
|
return new JsonResult<>(Code.FAILED, Message.FAILED,null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static JsonResult<String> failed(String msg) {
|
public static JsonResult<String> failed(String msg) {
|
||||||
return new JsonResult<String>(Code.FAILED, msg,null);
|
return new JsonResult<>(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<String>(code, msg,null);
|
return new JsonResult<>(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