feat(common): 添加 BusinessException/GlobalExceptionHandler/CompanyContext/状态枚举 (T007/T008/T012-T015)
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package com.label.common.exception;
|
||||
|
||||
import lombok.Getter;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
@Getter
|
||||
public class BusinessException extends RuntimeException {
|
||||
private final String code;
|
||||
private final HttpStatus httpStatus;
|
||||
|
||||
public BusinessException(String code, String message) {
|
||||
super(message);
|
||||
this.code = code;
|
||||
this.httpStatus = HttpStatus.BAD_REQUEST;
|
||||
}
|
||||
|
||||
public BusinessException(String code, String message, HttpStatus httpStatus) {
|
||||
super(message);
|
||||
this.code = code;
|
||||
this.httpStatus = httpStatus;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user