feat 同步商业版代码

This commit is contained in:
bootx
2025-04-27 21:46:54 +08:00
parent 36a6901f8e
commit 3ec34a191c
1067 changed files with 19660 additions and 26251 deletions

View File

@@ -15,6 +15,8 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.MDC;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.http.converter.HttpMessageConversionException;
import org.springframework.validation.BindException;
import org.springframework.web.HttpRequestMethodNotSupportedException;
@@ -38,6 +40,7 @@ public class RestExceptionHandler {
private final ExceptionHandlerProperties properties;
/**
* 普通业务异常, 不需要进行堆栈跟踪
*/
@@ -128,12 +131,13 @@ public class RestExceptionHandler {
}
/**
* 请求参数校验未通过
* 页面或资源不存在
*/
@ExceptionHandler({ NoResourceFoundException.class })
public Result<Void> handleBusinessException(NoResourceFoundException ex) {
public ResponseEntity<Result<Void>> handleBusinessException(NoResourceFoundException ex) {
log.info(ex.getMessage(), ex);
return Res.response(CommonErrorCode.SOURCES_NOT_EXIST, "页面或资源不存在", MDC.get(CommonCode.TRACE_ID));
Result<Void> result = Res.response(CommonErrorCode.SOURCES_NOT_EXIST, "页面或资源不存在", MDC.get(CommonCode.TRACE_ID));
return ResponseEntity.status(HttpStatus.NOT_FOUND).body(result);
}
/**