diff --git a/continew-starter-auth/continew-starter-auth-satoken/src/main/java/top/charles7c/continew/starter/auth/satoken/autoconfigure/SaTokenDaoConfiguration.java b/continew-starter-auth/continew-starter-auth-satoken/src/main/java/top/charles7c/continew/starter/auth/satoken/autoconfigure/SaTokenDaoConfiguration.java index 835fa504..dbe21a8b 100644 --- a/continew-starter-auth/continew-starter-auth-satoken/src/main/java/top/charles7c/continew/starter/auth/satoken/autoconfigure/SaTokenDaoConfiguration.java +++ b/continew-starter-auth/continew-starter-auth-satoken/src/main/java/top/charles7c/continew/starter/auth/satoken/autoconfigure/SaTokenDaoConfiguration.java @@ -37,6 +37,9 @@ import top.charles7c.continew.starter.cache.redisson.autoconfigure.RedissonAutoC @Slf4j abstract class SaTokenDaoConfiguration { + private SaTokenDaoConfiguration() { + } + /** * 自定义持久层实现类-Redis */ diff --git a/continew-starter-auth/continew-starter-auth-satoken/src/main/java/top/charles7c/continew/starter/auth/satoken/exception/GlobalSaTokenExceptionHandler.java b/continew-starter-auth/continew-starter-auth-satoken/src/main/java/top/charles7c/continew/starter/auth/satoken/exception/GlobalSaTokenExceptionHandler.java index 0282fd43..9ffae66b 100644 --- a/continew-starter-auth/continew-starter-auth-satoken/src/main/java/top/charles7c/continew/starter/auth/satoken/exception/GlobalSaTokenExceptionHandler.java +++ b/continew-starter-auth/continew-starter-auth-satoken/src/main/java/top/charles7c/continew/starter/auth/satoken/exception/GlobalSaTokenExceptionHandler.java @@ -40,7 +40,7 @@ public class GlobalSaTokenExceptionHandler { * 认证异常-登录认证 */ @ExceptionHandler(NotLoginException.class) - public R handleNotLoginException(NotLoginException e, HttpServletRequest request) { + public R handleNotLoginException(NotLoginException e, HttpServletRequest request) { log.error("请求地址 [{}],认证失败,无法访问系统资源。", request.getRequestURI(), e); String errorMsg = switch (e.getType()) { case NotLoginException.KICK_OUT -> "您已被踢下线。"; @@ -54,7 +54,7 @@ public class GlobalSaTokenExceptionHandler { * 认证异常-权限认证 */ @ExceptionHandler(NotPermissionException.class) - public R handleNotPermissionException(NotPermissionException e, HttpServletRequest request) { + public R handleNotPermissionException(NotPermissionException e, HttpServletRequest request) { log.error("请求地址 [{}],权限码校验失败。", request.getRequestURI(), e); return R.fail(HttpStatus.FORBIDDEN.value(), "没有访问权限,请联系管理员授权"); } @@ -63,7 +63,7 @@ public class GlobalSaTokenExceptionHandler { * 认证异常-角色认证 */ @ExceptionHandler(NotRoleException.class) - public R handleNotRoleException(NotRoleException e, HttpServletRequest request) { + public R handleNotRoleException(NotRoleException e, HttpServletRequest request) { log.error("请求地址 [{}],角色权限校验失败。", request.getRequestURI(), e); return R.fail(HttpStatus.FORBIDDEN.value(), "没有访问权限,请联系管理员授权"); } diff --git a/continew-starter-cache/continew-starter-cache-redisson/src/main/java/top/charles7c/continew/starter/cache/redisson/util/RedisUtils.java b/continew-starter-cache/continew-starter-cache-redisson/src/main/java/top/charles7c/continew/starter/cache/redisson/util/RedisUtils.java index cd99ff62..1fc73dfa 100644 --- a/continew-starter-cache/continew-starter-cache-redisson/src/main/java/top/charles7c/continew/starter/cache/redisson/util/RedisUtils.java +++ b/continew-starter-cache/continew-starter-cache-redisson/src/main/java/top/charles7c/continew/starter/cache/redisson/util/RedisUtils.java @@ -24,7 +24,6 @@ import top.charles7c.continew.starter.core.constant.StringConstants; import java.time.Duration; import java.util.Collection; -import java.util.stream.Collectors; import java.util.stream.Stream; /** @@ -138,7 +137,7 @@ public class RedisUtils { */ public static Collection keys(final String keyPattern) { Stream stream = CLIENT.getKeys().getKeysStreamByPattern(getNameMapper().map(keyPattern)); - return stream.map(key -> getNameMapper().unmap(key)).collect(Collectors.toList()); + return stream.map(key -> getNameMapper().unmap(key)).toList(); } /** diff --git a/continew-starter-captcha/continew-starter-captcha-behavior/src/main/java/top/charles7c/continew/starter/captcha/behavior/autoconfigure/BehaviorCaptchaCacheConfiguration.java b/continew-starter-captcha/continew-starter-captcha-behavior/src/main/java/top/charles7c/continew/starter/captcha/behavior/autoconfigure/BehaviorCaptchaCacheConfiguration.java index 9b735545..35faed28 100644 --- a/continew-starter-captcha/continew-starter-captcha-behavior/src/main/java/top/charles7c/continew/starter/captcha/behavior/autoconfigure/BehaviorCaptchaCacheConfiguration.java +++ b/continew-starter-captcha/continew-starter-captcha-behavior/src/main/java/top/charles7c/continew/starter/captcha/behavior/autoconfigure/BehaviorCaptchaCacheConfiguration.java @@ -42,6 +42,9 @@ import top.charles7c.continew.starter.core.constant.PropertiesConstants; @Slf4j abstract class BehaviorCaptchaCacheConfiguration { + private BehaviorCaptchaCacheConfiguration() { + } + /** * 自定义缓存实现类-Redis */ @@ -49,7 +52,8 @@ abstract class BehaviorCaptchaCacheConfiguration { @AutoConfigureBefore(RedissonAutoConfiguration.class) @ConditionalOnProperty(name = PropertiesConstants.CAPTCHA_BEHAVIOR + ".cache-type", havingValue = "redis") static class Redis { - static { + @PostConstruct + public void postConstruct() { CaptchaServiceFactory.cacheService.put(StorageType.REDIS.name() .toLowerCase(), new BehaviorCaptchaCacheServiceImpl()); log.debug("[ContiNew Starter] - Auto Configuration 'Behavior-CaptchaCache-Redis' completed initialization."); @@ -61,7 +65,6 @@ abstract class BehaviorCaptchaCacheConfiguration { */ @ConditionalOnProperty(name = PropertiesConstants.CAPTCHA_BEHAVIOR + ".cache-type", havingValue = "custom") static class Custom { - @Bean @ConditionalOnMissingBean public CaptchaCacheService captchaCacheService(BehaviorCaptchaProperties properties) { diff --git a/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/util/ClassUtils.java b/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/util/ClassUtils.java index 816ac744..58b80e0b 100644 --- a/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/util/ClassUtils.java +++ b/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/util/ClassUtils.java @@ -29,6 +29,9 @@ import java.lang.reflect.Type; */ public class ClassUtils { + private ClassUtils() { + } + /** * 获得给定类的所有泛型参数 * diff --git a/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/util/ReflectUtils.java b/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/util/ReflectUtils.java index a5c9863f..4bdcef05 100644 --- a/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/util/ReflectUtils.java +++ b/continew-starter-core/src/main/java/top/charles7c/continew/starter/core/util/ReflectUtils.java @@ -22,7 +22,6 @@ import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.Arrays; import java.util.List; -import java.util.stream.Collectors; /** * 反射工具类 @@ -45,7 +44,7 @@ public class ReflectUtils { */ public static List getNonStaticFieldsName(Class beanClass) throws SecurityException { List nonStaticFields = getNonStaticFields(beanClass); - return nonStaticFields.stream().map(Field::getName).collect(Collectors.toList()); + return nonStaticFields.stream().map(Field::getName).toList(); } /** @@ -58,6 +57,6 @@ public class ReflectUtils { */ public static List getNonStaticFields(Class beanClass) throws SecurityException { Field[] fields = ReflectUtil.getFields(beanClass); - return Arrays.stream(fields).filter(f -> !Modifier.isStatic(f.getModifiers())).collect(Collectors.toList()); + return Arrays.stream(fields).filter(f -> !Modifier.isStatic(f.getModifiers())).toList(); } } diff --git a/continew-starter-data/continew-starter-data-mybatis-plus/src/main/java/top/charles7c/continew/starter/data/mybatis/plus/datapermission/DataPermissionHandlerImpl.java b/continew-starter-data/continew-starter-data-mybatis-plus/src/main/java/top/charles7c/continew/starter/data/mybatis/plus/datapermission/DataPermissionHandlerImpl.java index 38664efa..12e2d87f 100644 --- a/continew-starter-data/continew-starter-data-mybatis-plus/src/main/java/top/charles7c/continew/starter/data/mybatis/plus/datapermission/DataPermissionHandlerImpl.java +++ b/continew-starter-data/continew-starter-data-mybatis-plus/src/main/java/top/charles7c/continew/starter/data/mybatis/plus/datapermission/DataPermissionHandlerImpl.java @@ -98,9 +98,8 @@ public class DataPermissionHandlerImpl implements DataPermissionHandler { return where; } if (DataScope.DEPT_AND_CHILD.equals(dataScope)) { - // select t1.* from table as t1 where t1.`dept_id` in (select `id` from `sys_dept` where `id` = xxx or - // find_in_set(xxx, `ancestors`)); // 构建子查询 + // 语句示例:select t1.* from table as t1 where t1.`dept_id` in (select `id` from `sys_dept` where `id` = xxx or find_in_set(xxx, `ancestors`)); SubSelect subSelect = new SubSelect(); PlainSelect select = new PlainSelect(); select.setSelectItems(Collections.singletonList(new SelectExpressionItem(new Column(id)))); @@ -120,21 +119,21 @@ public class DataPermissionHandlerImpl implements DataPermissionHandler { inExpression.setRightExpression(subSelect); expression = null != expression ? new OrExpression(expression, inExpression) : inExpression; } else if (DataScope.DEPT.equals(dataScope)) { - // select t1.* from table as t1 where t1.`dept_id` = xxx; + // 语句示例:select t1.* from table as t1 where t1.`dept_id` = xxx; EqualsTo equalsTo = new EqualsTo(); equalsTo.setLeftExpression(this.buildColumn(tableAlias, deptId)); equalsTo.setRightExpression(new LongValue(currentUser.getDeptId())); expression = null != expression ? new OrExpression(expression, equalsTo) : equalsTo; } else if (DataScope.SELF.equals(dataScope)) { - // select t1.* from table as t1 where t1.`create_user` = xxx; + // 语句示例:select t1.* from table as t1 where t1.`create_user` = xxx; EqualsTo equalsTo = new EqualsTo(); equalsTo.setLeftExpression(this.buildColumn(tableAlias, dataPermission.userId())); equalsTo.setRightExpression(new LongValue(currentUser.getUserId())); expression = null != expression ? new OrExpression(expression, equalsTo) : equalsTo; } else if (DataScope.CUSTOM.equals(dataScope)) { - // select t1.* from table as t1 where t1.`dept_id` in (select `dept_id` from `sys_role_dept` where - // `role_id` = xxx); // 构建子查询 + // 语句示例:select t1.* from table as t1 where t1.`dept_id` in (select `dept_id` from `sys_role_dept` where + // `role_id` = xxx); SubSelect subSelect = new SubSelect(); PlainSelect select = new PlainSelect(); select.setSelectItems(Collections.singletonList(new SelectExpressionItem(new Column(deptId)))); diff --git a/continew-starter-extension/continew-starter-extension-crud/src/main/java/top/charles7c/continew/starter/extension/crud/base/BaseController.java b/continew-starter-extension/continew-starter-extension-crud/src/main/java/top/charles7c/continew/starter/extension/crud/base/BaseController.java index b493f898..3aacf036 100644 --- a/continew-starter-extension/continew-starter-extension-crud/src/main/java/top/charles7c/continew/starter/extension/crud/base/BaseController.java +++ b/continew-starter-extension/continew-starter-extension-crud/src/main/java/top/charles7c/continew/starter/extension/crud/base/BaseController.java @@ -153,7 +153,7 @@ public abstract class BaseController, L, D, Q, @Parameter(name = "ids", description = "ID 列表", example = "1,2", in = ParameterIn.PATH) @ResponseBody @DeleteMapping("/{ids}") - public R delete(@PathVariable List ids) { + public R delete(@PathVariable List ids) { this.checkPermission(Api.DELETE); baseService.delete(ids); return R.ok("删除成功"); diff --git a/continew-starter-extension/continew-starter-extension-crud/src/main/java/top/charles7c/continew/starter/extension/crud/constant/ContainerPool.java b/continew-starter-extension/continew-starter-extension-crud/src/main/java/top/charles7c/continew/starter/extension/crud/constant/ContainerPool.java index 4cadf8fa..47fe0123 100644 --- a/continew-starter-extension/continew-starter-extension-crud/src/main/java/top/charles7c/continew/starter/extension/crud/constant/ContainerPool.java +++ b/continew-starter-extension/continew-starter-extension-crud/src/main/java/top/charles7c/continew/starter/extension/crud/constant/ContainerPool.java @@ -24,6 +24,9 @@ package top.charles7c.continew.starter.extension.crud.constant; */ public class ContainerPool { + private ContainerPool() { + } + /** * 用户昵称 */ diff --git a/continew-starter-extension/continew-starter-extension-crud/src/main/java/top/charles7c/continew/starter/extension/crud/handler/CrudRequestMappingHandlerMapping.java b/continew-starter-extension/continew-starter-extension-crud/src/main/java/top/charles7c/continew/starter/extension/crud/handler/CrudRequestMappingHandlerMapping.java index c8c5d797..e530d2a1 100644 --- a/continew-starter-extension/continew-starter-extension-crud/src/main/java/top/charles7c/continew/starter/extension/crud/handler/CrudRequestMappingHandlerMapping.java +++ b/continew-starter-extension/continew-starter-extension-crud/src/main/java/top/charles7c/continew/starter/extension/crud/handler/CrudRequestMappingHandlerMapping.java @@ -63,9 +63,9 @@ public class CrudRequestMappingHandlerMapping extends RequestMappingHandlerMappi private RequestMappingInfo getMappingForMethodWrapper(@NonNull Method method, @NonNull Class handlerType, CrudRequestMapping crudRequestMapping) { - RequestMappingInfo info = this.createRequestMappingInfo(method); + RequestMappingInfo info = this.buildRequestMappingInfo(method); if (null != info) { - RequestMappingInfo typeInfo = this.createRequestMappingInfo(handlerType); + RequestMappingInfo typeInfo = this.buildRequestMappingInfo(handlerType); if (null != typeInfo) { info = typeInfo.combine(info); } @@ -79,11 +79,11 @@ public class CrudRequestMappingHandlerMapping extends RequestMappingHandlerMappi return info; } - private RequestMappingInfo createRequestMappingInfo(AnnotatedElement element) { + private RequestMappingInfo buildRequestMappingInfo(AnnotatedElement element) { RequestMapping requestMapping = AnnotatedElementUtils.findMergedAnnotation(element, RequestMapping.class); RequestCondition condition = (element instanceof Class clazz ? getCustomTypeCondition(clazz) : getCustomMethodCondition((Method)element)); - return (requestMapping != null ? createRequestMappingInfo(requestMapping, condition) : null); + return (requestMapping != null ? super.createRequestMappingInfo(requestMapping, condition) : null); } } diff --git a/continew-starter-extension/continew-starter-extension-crud/src/main/java/top/charles7c/continew/starter/extension/crud/model/query/PageQuery.java b/continew-starter-extension/continew-starter-extension-crud/src/main/java/top/charles7c/continew/starter/extension/crud/model/query/PageQuery.java index f7f22e55..2b72029e 100644 --- a/continew-starter-extension/continew-starter-extension-crud/src/main/java/top/charles7c/continew/starter/extension/crud/model/query/PageQuery.java +++ b/continew-starter-extension/continew-starter-extension-crud/src/main/java/top/charles7c/continew/starter/extension/crud/model/query/PageQuery.java @@ -68,9 +68,6 @@ public class PageQuery extends SortQuery { @Range(min = 1, max = 1000, message = "每页条数(取值范围 {min}-{max})") private Integer size = DEFAULT_SIZE; - public PageQuery() { - } - /** * 基于分页查询条件转换为 MyBatis Plus 分页条件 * diff --git a/continew-starter-log/continew-starter-log-httptrace-pro/src/main/java/top/charles7c/continew/starter/log/httptracepro/handler/RecordableServletHttpRequest.java b/continew-starter-log/continew-starter-log-httptrace-pro/src/main/java/top/charles7c/continew/starter/log/httptracepro/handler/RecordableServletHttpRequest.java index 9b05bd17..3c481d55 100644 --- a/continew-starter-log/continew-starter-log-httptrace-pro/src/main/java/top/charles7c/continew/starter/log/httptracepro/handler/RecordableServletHttpRequest.java +++ b/continew-starter-log/continew-starter-log-httptrace-pro/src/main/java/top/charles7c/continew/starter/log/httptracepro/handler/RecordableServletHttpRequest.java @@ -57,12 +57,12 @@ public final class RecordableServletHttpRequest implements RecordableHttpRequest return URI.create(request.getRequestURL().toString()); } try { - StringBuffer urlBuffer = this.appendQueryString(queryString); - return new URI(urlBuffer.toString()); + StringBuilder urlBuilder = this.appendQueryString(queryString); + return new URI(urlBuilder.toString()); } catch (URISyntaxException e) { String encoded = UriUtils.encodeQuery(queryString, StandardCharsets.UTF_8); - StringBuffer urlBuffer = this.appendQueryString(encoded); - return URI.create(urlBuffer.toString()); + StringBuilder urlBuilder = this.appendQueryString(encoded); + return URI.create(urlBuilder.toString()); } } @@ -94,7 +94,9 @@ public final class RecordableServletHttpRequest implements RecordableHttpRequest : Collections.unmodifiableMap(request.getParameterMap()); } - private StringBuffer appendQueryString(String queryString) { - return request.getRequestURL().append(StringConstants.QUESTION_MARK).append(queryString); + private StringBuilder appendQueryString(String queryString) { + return new StringBuilder().append(request.getRequestURL()) + .append(StringConstants.QUESTION_MARK) + .append(queryString); } } \ No newline at end of file diff --git a/continew-starter-web/src/main/java/top/charles7c/continew/starter/web/core/exception/GlobalExceptionHandler.java b/continew-starter-web/src/main/java/top/charles7c/continew/starter/web/core/exception/GlobalExceptionHandler.java index 343e19c2..365544e9 100644 --- a/continew-starter-web/src/main/java/top/charles7c/continew/starter/web/core/exception/GlobalExceptionHandler.java +++ b/continew-starter-web/src/main/java/top/charles7c/continew/starter/web/core/exception/GlobalExceptionHandler.java @@ -47,11 +47,13 @@ import top.charles7c.continew.starter.web.model.R; @RestControllerAdvice public class GlobalExceptionHandler { + private static final String PARAM_FAILED = "请求地址 [{}],参数验证失败。"; + /** * 拦截自定义验证异常-错误请求 */ @ExceptionHandler(BadRequestException.class) - public R handleBadRequestException(BadRequestException e, HttpServletRequest request) { + public R handleBadRequestException(BadRequestException e, HttpServletRequest request) { log.warn("请求地址 [{}],自定义验证失败。", request.getRequestURI(), e); return R.fail(HttpStatus.BAD_REQUEST.value(), e.getMessage()); } @@ -60,8 +62,8 @@ public class GlobalExceptionHandler { * 拦截校验异常-违反约束异常 */ @ExceptionHandler(ConstraintViolationException.class) - public R constraintViolationException(ConstraintViolationException e, HttpServletRequest request) { - log.warn("请求地址 [{}],参数验证失败。", request.getRequestURI(), e); + public R constraintViolationException(ConstraintViolationException e, HttpServletRequest request) { + log.warn(PARAM_FAILED, request.getRequestURI(), e); String errorMsg = CollUtil.join(e .getConstraintViolations(), StringConstants.CHINESE_COMMA, ConstraintViolation::getMessage); return R.fail(HttpStatus.BAD_REQUEST.value(), errorMsg); @@ -71,8 +73,8 @@ public class GlobalExceptionHandler { * 拦截校验异常-绑定异常 */ @ExceptionHandler(BindException.class) - public R handleBindException(BindException e, HttpServletRequest request) { - log.warn("请求地址 [{}],参数验证失败。", request.getRequestURI(), e); + public R handleBindException(BindException e, HttpServletRequest request) { + log.warn(PARAM_FAILED, request.getRequestURI(), e); String errorMsg = CollUtil.join(e .getAllErrors(), StringConstants.CHINESE_COMMA, DefaultMessageSourceResolvable::getDefaultMessage); return R.fail(HttpStatus.BAD_REQUEST.value(), errorMsg); @@ -82,8 +84,9 @@ public class GlobalExceptionHandler { * 拦截校验异常-方法参数无效异常 */ @ExceptionHandler(MethodArgumentNotValidException.class) - public R handleMethodArgumentNotValidException(MethodArgumentNotValidException e, HttpServletRequest request) { - log.warn("请求地址 [{}],参数验证失败。", request.getRequestURI(), e); + public R handleMethodArgumentNotValidException(MethodArgumentNotValidException e, + HttpServletRequest request) { + log.warn(PARAM_FAILED, request.getRequestURI(), e); String errorMsg = CollUtil.join(e .getAllErrors(), StringConstants.CHINESE_COMMA, DefaultMessageSourceResolvable::getDefaultMessage); return R.fail(HttpStatus.BAD_REQUEST.value(), errorMsg); @@ -93,8 +96,8 @@ public class GlobalExceptionHandler { * 拦截校验异常-方法参数类型不匹配异常 */ @ExceptionHandler(MethodArgumentTypeMismatchException.class) - public R handleMethodArgumentTypeMismatchException(MethodArgumentTypeMismatchException e, - HttpServletRequest request) { + public R handleMethodArgumentTypeMismatchException(MethodArgumentTypeMismatchException e, + HttpServletRequest request) { String errorMsg = StrUtil.format("参数名:[{}],期望参数类型:[{}]", e.getName(), e.getParameter().getParameterType()); log.warn("请求地址 [{}],参数转换失败,{}。", request.getRequestURI(), errorMsg, e); return R.fail(HttpStatus.BAD_REQUEST.value(), errorMsg); @@ -104,7 +107,7 @@ public class GlobalExceptionHandler { * 拦截文件上传异常-超过上传大小限制 */ @ExceptionHandler(MaxUploadSizeExceededException.class) - public R handleMaxUploadSizeExceededException(MaxUploadSizeExceededException e, HttpServletRequest request) { + public R handleMaxUploadSizeExceededException(MaxUploadSizeExceededException e, HttpServletRequest request) { log.warn("请求地址 [{}],上传文件失败,文件大小超过限制。", request.getRequestURI(), e); String sizeLimit = StrUtil.subBetween(e.getMessage(), "The maximum size ", " for"); String errorMsg = String.format("请上传小于 %sMB 的文件", NumberUtil.parseLong(sizeLimit) / 1024 / 1024); @@ -115,7 +118,8 @@ public class GlobalExceptionHandler { * 拦截校验异常-请求方式不支持异常 */ @ExceptionHandler(HttpRequestMethodNotSupportedException.class) - public R handleHttpRequestMethodNotSupported(HttpRequestMethodNotSupportedException e, HttpServletRequest request) { + public R handleHttpRequestMethodNotSupported(HttpRequestMethodNotSupportedException e, + HttpServletRequest request) { log.error("请求地址 [{}],不支持 [{}] 请求。", request.getRequestURI(), e.getMethod()); return R.fail(HttpStatus.METHOD_NOT_ALLOWED.value(), e.getMessage()); } @@ -124,7 +128,7 @@ public class GlobalExceptionHandler { * 拦截业务异常 */ @ExceptionHandler(BusinessException.class) - public R handleServiceException(BusinessException e, HttpServletRequest request) { + public R handleServiceException(BusinessException e, HttpServletRequest request) { log.error("请求地址 [{}],发生业务异常。", request.getRequestURI(), e); return R.fail(HttpStatus.INTERNAL_SERVER_ERROR.value(), e.getMessage()); } @@ -133,7 +137,7 @@ public class GlobalExceptionHandler { * 拦截未知的运行时异常 */ @ExceptionHandler(RuntimeException.class) - public R handleRuntimeException(RuntimeException e, HttpServletRequest request) { + public R handleRuntimeException(RuntimeException e, HttpServletRequest request) { log.error("请求地址 [{}],发生系统异常。", request.getRequestURI(), e); return R.fail(e.getMessage()); } @@ -142,7 +146,7 @@ public class GlobalExceptionHandler { * 拦截未知的系统异常 */ @ExceptionHandler(Throwable.class) - public R handleException(Throwable e, HttpServletRequest request) { + public R handleException(Throwable e, HttpServletRequest request) { log.error("请求地址 [{}],发生未知异常。", request.getRequestURI(), e); return R.fail(e.getMessage()); }