Commit 1cc4e5a4 by 111-PC\111

[+]试驾错误码

1 parent bdff9823
...@@ -17,7 +17,7 @@ public enum ResultEnum { ...@@ -17,7 +17,7 @@ public enum ResultEnum {
/** /**
* 试驾服务相关业务异常错误码,错误信息 * 试驾服务相关业务异常错误码,错误信息
*/ */
APPROVAL_ALREADY_EXISTS(12110001,"改业务审批单已经存在"); APPROVAL_ALREADY_EXISTS(12110001,"该业务审批单已经存在");
private final Integer code; private final Integer code;
private final String message; private final String message;
......
...@@ -13,6 +13,8 @@ public class AdminException extends RuntimeException { ...@@ -13,6 +13,8 @@ public class AdminException extends RuntimeException {
private int errorCode; private int errorCode;
private String message;
public AdminException() { public AdminException() {
} }
...@@ -26,8 +28,8 @@ public class AdminException extends RuntimeException { ...@@ -26,8 +28,8 @@ public class AdminException extends RuntimeException {
} }
public AdminException(ResultEnum resultEnum) { public AdminException(ResultEnum resultEnum) {
super(resultEnum.getMessage());
this.errorCode = resultEnum.getCode(); this.errorCode = resultEnum.getCode();
this.message = resultEnum.getMessage();
} }
public AdminException(Throwable cause) { public AdminException(Throwable cause) {
......
...@@ -19,7 +19,7 @@ public class AdminExceptionHandler extends GlobalExceptionHandler { ...@@ -19,7 +19,7 @@ public class AdminExceptionHandler extends GlobalExceptionHandler {
@ExceptionHandler(AdminException.class) @ExceptionHandler(AdminException.class)
public R handleAdminException(AdminException e) { public R handleAdminException(AdminException e) {
return R.error(e.getMessage()); return R.error(e.getErrorCode(),e.getMessage());
} }
/** /**
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!