Commit 5d42dad4 authored by 张庆's avatar 张庆

请求参数

parent f49090c4
......@@ -33,52 +33,6 @@ public class ZyJsonResult<T> implements Serializable {
this.message = message;
}
public static JsonResult success() {
return new JsonResult(true, "200", "操作成功!");
}
public static JsonResult success(Object data) {
JsonResult result = new JsonResult(true, "200", "操作成功!");
result.setResult(data);
return result;
}
public static JsonResult error(String message) {
JsonResult result = new JsonResult(false, "500", message);
return result;
}
public static JsonResult error(ExceptionCodeEnum message) {
JsonResult result = new JsonResult(false, message.getCode(), message.getMessageCN());
return result;
}
public static JsonResult error(ExceptionCodeEnum message, String msg) {
JsonResult result = new JsonResult(false, message.getCode(), msg);
return result;
}
public static JsonResult error(String message, String code) {
JsonResult result = new JsonResult(false, code, message);
result.setCode(code);
return result;
}
public void apiCheck() {
if (!this.isSuccess()) {
throw new BizException(ExceptionCodeEnum.SYSTEM_REMOTE_ERROR, message);
}
}
public void resultCheck() {
if (!this.isSuccess()) {
throw new BizException(ExceptionCodeEnum.SYSTEM_REMOTE_ERROR, message);
}
if (this.getResult() == null) {
throw new BizException(ExceptionCodeEnum.SYSTEM_REMOTE_ERROR, message);
}
}
public String getCode() {
return this.code;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment