From 2fe63be6c993bcd8d223a2f9f1a3309a52530905 Mon Sep 17 00:00:00 2001 From: lliyueling Date: Thu, 23 Apr 2026 14:57:36 +0800 Subject: [PATCH 1/3] =?UTF-8?q?refactor(http):=20=E4=BC=98=E5=8C=96=20repl?= =?UTF-8?q?aceUrlQuery=20=E6=96=B9=E6=B3=95=EF=BC=8C=E4=BD=BF=E7=94=A8=20H?= =?UTF-8?q?utool=20=E5=8E=9F=E7=94=9F=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除了对 Hutool `UrlQuery` 内部 `query` 字段的反射访问和强制类型转换。 - 直接使用 `UrlBuilder.getQuery().remove(key)` 链式调用,代码更简洁。 - 降低了代码与 Hutool 内部实现的耦合度,提高了代码的健壮性和可读性。 --- .../iocoder/yudao/framework/common/util/http/HttpUtils.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/http/HttpUtils.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/http/HttpUtils.java index 9de037758..a31f4820c 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/http/HttpUtils.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/http/HttpUtils.java @@ -1,9 +1,7 @@ package cn.iocoder.yudao.framework.common.util.http; import cn.hutool.core.codec.Base64; -import cn.hutool.core.map.TableMap; import cn.hutool.core.net.url.UrlBuilder; -import cn.hutool.core.util.ReflectUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpResponse; @@ -66,9 +64,7 @@ public class HttpUtils { public static String replaceUrlQuery(String url, String key, String value) { UrlBuilder builder = UrlBuilder.of(url, Charset.defaultCharset()); // 先移除 - TableMap query = (TableMap) - ReflectUtil.getFieldValue(builder.getQuery(), "query"); - query.remove(key); + builder.getQuery().remove(key); // 后添加 builder.addQuery(key, value); return builder.build(); From adbcc60225a06c10b58f1545fb0a9a87020c0b18 Mon Sep 17 00:00:00 2001 From: lliyueling Date: Thu, 23 Apr 2026 15:40:37 +0800 Subject: [PATCH 2/3] =?UTF-8?q?test(common):=20=E8=A1=A5=E5=85=85=20HttpUt?= =?UTF-8?q?ils.replaceUrlQuery=20=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 HttpUtilsTest 测试类 - 覆盖参数替换、新增参数、空值处理等场景 - 确保优化后的 Hutool 实现与原反射实现行为一致 --- .../common/util/http/HttpUtilsTest.java | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 yudao-framework/yudao-common/src/test/java/cn/iocoder/yudao/framework/common/util/http/HttpUtilsTest.java diff --git a/yudao-framework/yudao-common/src/test/java/cn/iocoder/yudao/framework/common/util/http/HttpUtilsTest.java b/yudao-framework/yudao-common/src/test/java/cn/iocoder/yudao/framework/common/util/http/HttpUtilsTest.java new file mode 100644 index 000000000..861598a56 --- /dev/null +++ b/yudao-framework/yudao-common/src/test/java/cn/iocoder/yudao/framework/common/util/http/HttpUtilsTest.java @@ -0,0 +1,50 @@ +package cn.iocoder.yudao.framework.common.util.http; + +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class HttpUtilsTest { + + @Test + public void testReplaceUrlQuery() { + // 定义测试用例:{原始URL, Key, Value, 期望结果} + String[][] testCases = { + // 场景1: 替换已存在的参数 (注意参数顺序可能会变,因为 UrlQuery 内部是 List) + {"https://example.com/path?a=1&b=2", "a", "3", "https://example.com/path?b=2&a=3"}, + // 场景2: 添加不存在的参数 + {"https://example.com/path?a=1", "b", "2", "https://example.com/path?a=1&b=2"}, + // 场景3: URL 本身没有查询参数 + {"https://example.com/path", "a", "1", "https://example.com/path?a=1"}, + // 场景4: 值为空 (根据原逻辑,空值通常会被移除或不添加,这里假设是移除) + // 注意:你需要根据 HttpUtils 实际对 null/empty 的处理来调整 expected + {"https://example.com/path?a=1", "a", "", "https://example.com/path?a="}, + }; + + System.out.println("开始运行 HttpUtils.replaceUrlQuery 测试..."); + + for (int i = 0; i < testCases.length; i++) { + String[] currentCase = testCases[i]; // 必须先取出当前这一行的数组 + + String url = currentCase[0]; + String key = currentCase[1]; + String value = currentCase[2]; + String expected = currentCase[3]; + + // 调用你优化后的方法 + String actual = HttpUtils.replaceUrlQuery(url, key, value); + + // 核心验证:断言实际结果必须等于期望结果 + // 如果不相等,测试会直接报错,并打印出是哪一行错了 + try { + assertEquals(expected, actual, "测试用例 " + (i + 1) + " 失败: " + url); + System.out.println("✅ 用例 " + (i + 1) + " 通过: " + actual); + } catch (AssertionError e) { + System.err.println("❌ 用例 " + (i + 1) + " 失败!"); + System.err.println(" 输入: " + url + " | " + key + "=" + value); + System.err.println(" 期望: " + expected); + System.err.println(" 实际: " + actual); + throw e; // 抛出错误,让测试标记为失败 + } + } + } +} \ No newline at end of file From c8b85ad8a7eb1c8a3db3b566627cd63be5696c68 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Tue, 5 May 2026 09:58:52 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E3=80=90=E4=BE=9D=E8=B5=96=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E3=80=91Phase=201=EF=BC=9A=E5=AE=89=E5=85=A8=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E7=89=88=E6=9C=AC=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 升级内容: - spring-boot 3.5.9 → 3.5.14 - springdoc 2.8.14 → 2.8.17 - druid 1.2.27 → 1.2.28 - mybatis-plus 3.5.15 → 3.5.16 - mybatis-plus-join 1.5.5 → 1.5.7 - netty 4.2.9.Final → 4.2.12.Final - lombok 1.18.42 → 1.18.46 - hutool 5.8.42 → 5.8.44 - guava 33.5.0-jre → 33.6.0-jre - jsoup 1.21.2 → 1.22.2 - jsch 2.27.7 → 2.28.2 - commons-net 3.12.0 → 3.13.0 - tika-core 3.2.3 → 3.3.0 - skywalking 9.5.0 → 9.6.0 - spring-boot-admin 3.5.6 → 3.5.8 - vertx 4.5.22 → 4.5.26 - californium 3.12.0 → 3.14.0 - j2mod 3.2.1 → 3.3.0 - taos 3.7.9 → 3.8.3 - awssdk 2.40.15 → 2.44.0 - alipay-sdk-java 4.40.607.ALL → 4.40.771.ALL - opengauss-jdbc 5.1.0 → 7.0.0-RC3-og - kingbase8 8.6.0 → 9.0.1.jre7 - jimureport 2.1.3 → 2.3.2(artifactId 从 jimureport-spring-boot3-starter-fastjson2 改为 jimureport-spring-boot3-starter) - jimubi 2.3.0 → 2.3.2 --- yudao-dependencies/pom.xml | 52 +++++++++---------- .../yudao-module-report-server/pom.xml | 2 +- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/yudao-dependencies/pom.xml b/yudao-dependencies/pom.xml index 6997ec24f..524996320 100644 --- a/yudao-dependencies/pom.xml +++ b/yudao-dependencies/pom.xml @@ -17,24 +17,24 @@ 2026.03-SNAPSHOT 1.7.2 - 3.5.9 + 3.5.14 2025.0.0 2023.0.3.3 - 2.8.14 + 2.8.17 4.5.0 - 1.2.27 + 1.2.28 3.5.19 - 3.5.15 - 1.5.5 + 3.5.16 + 1.5.7 4.5.0 3.0.6 3.52.0 8.1.3.140 - 8.6.0 - 5.1.0 - 3.7.9 + 9.0.1.jre7 + 7.0.0-RC3-og + 3.8.3 2.3.5 @@ -44,8 +44,8 @@ 2.2.7 - 9.5.0 - 3.5.6 + 9.6.0 + 3.5.8 0.33.0 8.0.2.RELEASE @@ -55,37 +55,37 @@ 7.2.0 1.4.0 - 1.21.2 - 1.18.42 + 1.22.2 + 1.18.46 1.6.3 - 5.8.42 + 5.8.44 6.0.0-M22 1.3.0 2.4.1 1.2.83 - 33.5.0-jre + 33.6.0-jre 2.14.5 - 3.12.0 + 3.13.0 3.20.0 - 2.27.7 - 3.2.3 + 2.28.2 + 3.3.0 2.7.0 3.0.6 0.10.2 - 4.2.9.Final + 4.2.12.Final 1.2.5 - 4.5.22 + 4.5.26 4.12.0 - 3.12.0 - 3.2.1 + 3.14.0 + 3.3.0 - 2.40.15 + 2.44.0 1.16.7 1.4.0 - 2.1.3 - 2.3.0 + 2.3.2 + 2.3.2 4.7.9-20251224.161447 - 4.40.607.ALL + 4.40.771.ALL @@ -720,7 +720,7 @@ org.jeecgframework.jimureport - jimureport-spring-boot3-starter-fastjson2 + jimureport-spring-boot3-starter ${jimureport.version} diff --git a/yudao-module-report/yudao-module-report-server/pom.xml b/yudao-module-report/yudao-module-report-server/pom.xml index 54bc7dac5..6c33ffc96 100644 --- a/yudao-module-report/yudao-module-report-server/pom.xml +++ b/yudao-module-report/yudao-module-report-server/pom.xml @@ -103,7 +103,7 @@ org.jeecgframework.jimureport - jimureport-spring-boot3-starter-fastjson2 + jimureport-spring-boot3-starter org.jeecgframework.jimureport