初始化 system 服务

This commit is contained in:
YunaiV
2022-06-02 09:29:35 +08:00
parent 12e2ce99e1
commit 5b2616fac1
13 changed files with 788 additions and 77 deletions

View File

@@ -83,9 +83,9 @@ public class GlobalExceptionHandler {
if (ex instanceof HttpRequestMethodNotSupportedException) {
return httpRequestMethodNotSupportedExceptionHandler((HttpRequestMethodNotSupportedException) ex);
}
if (ex instanceof RequestNotPermitted) {
return requestNotPermittedExceptionHandler(request, (RequestNotPermitted) ex);
}
// if (ex instanceof RequestNotPermitted) {
// return requestNotPermittedExceptionHandler(request, (RequestNotPermitted) ex);
// }
if (ex instanceof ServiceException) {
return serviceExceptionHandler((ServiceException) ex);
}
@@ -183,14 +183,15 @@ public class GlobalExceptionHandler {
return CommonResult.error(METHOD_NOT_ALLOWED.getCode(), String.format("请求方法不正确:%s", ex.getMessage()));
}
/**
* 处理 Resilience4j 限流抛出的异常
*/
@ExceptionHandler(value = RequestNotPermitted.class)
public CommonResult<?> requestNotPermittedExceptionHandler(HttpServletRequest req, RequestNotPermitted ex) {
log.warn("[requestNotPermittedExceptionHandler][url({}) 访问过于频繁]", req.getRequestURL(), ex);
return CommonResult.error(TOO_MANY_REQUESTS);
}
// TODO 芋艿:暂时去掉
// /**
// * 处理 Resilience4j 限流抛出的异常
// */
// @ExceptionHandler(value = RequestNotPermitted.class)
// public CommonResult<?> requestNotPermittedExceptionHandler(HttpServletRequest req, RequestNotPermitted ex) {
// log.warn("[requestNotPermittedExceptionHandler][url({}) 访问过于频繁]", req.getRequestURL(), ex);
// return CommonResult.error(TOO_MANY_REQUESTS);
// }
/**
* 处理 Spring Security 权限不足的异常