mirror of
https://github.com/codewendao/PayPro.git
synced 2026-09-03 06:13:46 +08:00
全局异常处理
订单开放接口
This commit is contained in:
30
src/main/java/com/wendao/exception/ApiException.java
Normal file
30
src/main/java/com/wendao/exception/ApiException.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package com.wendao.exception;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public class ApiException extends RuntimeException {
|
||||
|
||||
private final int code;
|
||||
private final String message;
|
||||
|
||||
public ApiException(int code, String message) {
|
||||
super(message);
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public ApiException(String message) {
|
||||
this(500, message);
|
||||
}
|
||||
|
||||
public static class ErrorCode {
|
||||
public static final int SUCCESS = 200;
|
||||
public static final int INVALID_PARAM = 400;
|
||||
public static final int SIGN_ERROR = 401;
|
||||
public static final int TIMESTAMP_ERROR = 402;
|
||||
public static final int DUPLICATE_ORDER = 403;
|
||||
public static final int AMOUNT_ERROR = 404;
|
||||
public static final int SYSTEM_ERROR = 500;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user