From 2fdd5b6fd3cdde0815262d2f804636f576ac740a Mon Sep 17 00:00:00 2001 From: Charles7c Date: Wed, 21 May 2025 22:18:10 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=BC=98=E5=8C=96=E9=83=A8=E5=88=86?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=A0=BC=E5=BC=8F=E5=92=8C=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../continew-starter-auth-satoken/pom.xml | 2 +- .../idempotent/aop/IdempotentAspect.java | 3 +-- .../starter/json/jackson/util/JSONUtils.java | 3 +-- continew-starter-log/pom.xml | 2 +- continew-starter-ratelimiter/pom.xml | 2 +- .../ratelimiter/aop/RateLimiterAspect.java | 3 +-- .../continew-starter-security-xss/pom.xml | 2 +- continew-starter-trace/pom.xml | 12 ++++----- .../continew-starter-web-core/pom.xml | 27 ++++++++----------- .../starter/web/util/ServletUtils.java | 11 +------- .../continew-starter-web-support/pom.xml | 20 ++++++-------- 11 files changed, 33 insertions(+), 54 deletions(-) diff --git a/continew-starter-auth/continew-starter-auth-satoken/pom.xml b/continew-starter-auth/continew-starter-auth-satoken/pom.xml index 41e0e9a1..a771992c 100644 --- a/continew-starter-auth/continew-starter-auth-satoken/pom.xml +++ b/continew-starter-auth/continew-starter-auth-satoken/pom.xml @@ -13,7 +13,7 @@ ContiNew Starter 认证模块 - SaToken - + top.continew continew-starter-web-core diff --git a/continew-starter-idempotent/src/main/java/top/continew/starter/idempotent/aop/IdempotentAspect.java b/continew-starter-idempotent/src/main/java/top/continew/starter/idempotent/aop/IdempotentAspect.java index ab32d7f1..656cb306 100644 --- a/continew-starter-idempotent/src/main/java/top/continew/starter/idempotent/aop/IdempotentAspect.java +++ b/continew-starter-idempotent/src/main/java/top/continew/starter/idempotent/aop/IdempotentAspect.java @@ -18,7 +18,6 @@ package top.continew.starter.idempotent.aop; import cn.hutool.core.convert.Convert; import cn.hutool.core.text.CharSequenceUtil; -import cn.hutool.core.util.ObjectUtil; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; @@ -98,7 +97,7 @@ public class IdempotentAspect { String key = idempotent.key(); if (CharSequenceUtil.isNotBlank(key)) { Object eval = ExpressionUtils.eval(key, target, method, args); - if (ObjectUtil.isNull(eval)) { + if (eval == null) { throw new IdempotentException("幂等 Key 解析错误"); } key = Convert.toStr(eval); diff --git a/continew-starter-json/continew-starter-json-jackson/src/main/java/top/continew/starter/json/jackson/util/JSONUtils.java b/continew-starter-json/continew-starter-json-jackson/src/main/java/top/continew/starter/json/jackson/util/JSONUtils.java index b5903997..53559fe1 100644 --- a/continew-starter-json/continew-starter-json-jackson/src/main/java/top/continew/starter/json/jackson/util/JSONUtils.java +++ b/continew-starter-json/continew-starter-json-jackson/src/main/java/top/continew/starter/json/jackson/util/JSONUtils.java @@ -16,7 +16,6 @@ package top.continew.starter.json.jackson.util; -import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.extra.spring.SpringUtil; import com.fasterxml.jackson.core.JsonProcessingException; @@ -61,7 +60,7 @@ public class JSONUtils { * @return {@link String } */ public static String toJsonStr(Object object) { - if (ObjectUtil.isNull(object)) { + if (object == null) { return null; } try { diff --git a/continew-starter-log/pom.xml b/continew-starter-log/pom.xml index 32035c1e..72f88fec 100644 --- a/continew-starter-log/pom.xml +++ b/continew-starter-log/pom.xml @@ -20,7 +20,7 @@ - + top.continew continew-starter-web-core diff --git a/continew-starter-ratelimiter/pom.xml b/continew-starter-ratelimiter/pom.xml index 1186d702..cddcc561 100644 --- a/continew-starter-ratelimiter/pom.xml +++ b/continew-starter-ratelimiter/pom.xml @@ -11,7 +11,7 @@ ContiNew Starter 限流模块 - + top.continew continew-starter-web-core diff --git a/continew-starter-ratelimiter/src/main/java/top/continew/starter/ratelimiter/aop/RateLimiterAspect.java b/continew-starter-ratelimiter/src/main/java/top/continew/starter/ratelimiter/aop/RateLimiterAspect.java index 66ac5a60..34984530 100644 --- a/continew-starter-ratelimiter/src/main/java/top/continew/starter/ratelimiter/aop/RateLimiterAspect.java +++ b/continew-starter-ratelimiter/src/main/java/top/continew/starter/ratelimiter/aop/RateLimiterAspect.java @@ -18,7 +18,6 @@ package top.continew.starter.ratelimiter.aop; import cn.hutool.core.convert.Convert; import cn.hutool.core.text.CharSequenceUtil; -import cn.hutool.core.util.ObjectUtil; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; @@ -162,7 +161,7 @@ public class RateLimiterAspect { String key = rateLimiter.key(); if (CharSequenceUtil.isNotBlank(key)) { Object eval = ExpressionUtils.eval(key, target, method, args); - if (ObjectUtil.isNull(eval)) { + if (eval == null) { throw new RateLimiterException("限流 Key 解析错误"); } key = Convert.toStr(eval); diff --git a/continew-starter-security/continew-starter-security-xss/pom.xml b/continew-starter-security/continew-starter-security-xss/pom.xml index 59dbcb4f..97b715a8 100644 --- a/continew-starter-security/continew-starter-security-xss/pom.xml +++ b/continew-starter-security/continew-starter-security-xss/pom.xml @@ -13,7 +13,7 @@ ContiNew Starter 安全模块 - XSS 过滤模块 - + top.continew continew-starter-web-core diff --git a/continew-starter-trace/pom.xml b/continew-starter-trace/pom.xml index 4b93dc76..afe9d4d8 100644 --- a/continew-starter-trace/pom.xml +++ b/continew-starter-trace/pom.xml @@ -13,18 +13,18 @@ ContiNew Starter 链路追踪模块 - - - jakarta.servlet - jakarta.servlet-api - - top.continew continew-starter-core + + + jakarta.servlet + jakarta.servlet-api + + com.yomahub diff --git a/continew-starter-web/continew-starter-web-core/pom.xml b/continew-starter-web/continew-starter-web-core/pom.xml index 002020a0..473ca932 100644 --- a/continew-starter-web/continew-starter-web-core/pom.xml +++ b/continew-starter-web/continew-starter-web-core/pom.xml @@ -12,6 +12,17 @@ ContiNew Starter Web 模块 - 核心模块 + + + top.continew + continew-starter-core + + + + + top.continew + continew-starter-json-jackson + @@ -31,21 +42,5 @@ jakarta.servlet jakarta.servlet-api - - - - top.continew - continew-starter-core - - - - - top.continew - continew-starter-json-jackson - - - - - diff --git a/continew-starter-web/continew-starter-web-core/src/main/java/top/continew/starter/web/util/ServletUtils.java b/continew-starter-web/continew-starter-web-core/src/main/java/top/continew/starter/web/util/ServletUtils.java index c33e0129..ecdebdb7 100644 --- a/continew-starter-web/continew-starter-web-core/src/main/java/top/continew/starter/web/util/ServletUtils.java +++ b/continew-starter-web/continew-starter-web-core/src/main/java/top/continew/starter/web/util/ServletUtils.java @@ -24,7 +24,6 @@ import cn.hutool.http.useragent.UserAgentUtil; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpSession; -import org.apache.commons.lang3.StringUtils; import org.springframework.web.context.request.RequestAttributes; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; @@ -69,9 +68,6 @@ public class ServletUtils extends JakartaServletUtil { * @return 浏览器及其版本信息 */ public static String getBrowser(String userAgentString) { - if (StringUtils.isBlank(userAgentString)) { - return null; - } try { UserAgent userAgent = UserAgentUtil.parse(userAgentString); if (userAgent == null || userAgent.getBrowser() == null) { @@ -79,9 +75,7 @@ public class ServletUtils extends JakartaServletUtil { } String browserName = userAgent.getBrowser().getName(); String version = userAgent.getVersion(); - return StringUtils.isBlank(version) - ? browserName - : browserName + StringConstants.SPACE + version; + return CharSequenceUtil.isBlank(version) ? browserName : browserName + StringConstants.SPACE + version; } catch (Exception e) { return null; } @@ -107,9 +101,6 @@ public class ServletUtils extends JakartaServletUtil { * @return 操作系统 */ public static String getOs(String userAgentString) { - if (StringUtils.isEmpty(userAgentString)) { - return null; - } try { UserAgent userAgent = UserAgentUtil.parse(userAgentString); if (userAgent == null || userAgent.getOs() == null) { diff --git a/continew-starter-web/continew-starter-web-support/pom.xml b/continew-starter-web/continew-starter-web-support/pom.xml index 70f88402..1b3efa93 100644 --- a/continew-starter-web/continew-starter-web-support/pom.xml +++ b/continew-starter-web/continew-starter-web-support/pom.xml @@ -2,7 +2,6 @@ 4.0.0 - top.continew continew-starter-web @@ -13,12 +12,19 @@ ContiNew Starter Web 模块 - 增强支持模块 - + top.continew continew-starter-web-core + + + top.continew + continew-starter-api-doc + true + + org.springframework.boot @@ -30,15 +36,5 @@ com.feiniaojin graceful-response - - - - top.continew - continew-starter-api-doc - true - - - -