From 88de9c24474454e572705b75c2fcfe1bc2a5af16 Mon Sep 17 00:00:00 2001 From: lizhengwei Date: Mon, 1 Dec 2025 14:13:55 +0800 Subject: [PATCH] =?UTF-8?q?pom=E4=BC=98=E5=8C=96=EF=BC=8C=E8=AE=A9?= =?UTF-8?q?=E5=85=B6=E6=9B=B4=E7=8B=AC=E7=AB=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-common/ruoyi-common-json/pom.xml | 21 +++++++++++++++++-- .../dromara/common/json/utils/JsonUtils.java | 16 +++++++------- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/ruoyi-common/ruoyi-common-json/pom.xml b/ruoyi-common/ruoyi-common-json/pom.xml index 870df5cdc..586a1dcc7 100644 --- a/ruoyi-common/ruoyi-common-json/pom.xml +++ b/ruoyi-common/ruoyi-common-json/pom.xml @@ -16,9 +16,26 @@ + - org.dromara - ruoyi-common-core + org.springframework + spring-web + + + org.springframework.boot + spring-boot-starter-aop + + + cn.hutool + hutool-core + + + cn.hutool + hutool-extra + + + org.projectlombok + lombok diff --git a/ruoyi-common/ruoyi-common-json/src/main/java/org/dromara/common/json/utils/JsonUtils.java b/ruoyi-common/ruoyi-common-json/src/main/java/org/dromara/common/json/utils/JsonUtils.java index 65c2faaed..a62b1b234 100644 --- a/ruoyi-common/ruoyi-common-json/src/main/java/org/dromara/common/json/utils/JsonUtils.java +++ b/ruoyi-common/ruoyi-common-json/src/main/java/org/dromara/common/json/utils/JsonUtils.java @@ -3,14 +3,14 @@ package org.dromara.common.json.utils; import cn.hutool.core.lang.Dict; import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.extra.spring.SpringUtil; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.exc.MismatchedInputException; import lombok.AccessLevel; import lombok.NoArgsConstructor; -import org.dromara.common.core.utils.SpringUtils; -import org.dromara.common.core.utils.StringUtils; import java.io.IOException; import java.util.ArrayList; @@ -24,7 +24,7 @@ import java.util.List; @NoArgsConstructor(access = AccessLevel.PRIVATE) public class JsonUtils { - private static final ObjectMapper OBJECT_MAPPER = SpringUtils.getBean(ObjectMapper.class); + private static final ObjectMapper OBJECT_MAPPER = SpringUtil.getBean(ObjectMapper.class); public static ObjectMapper getObjectMapper() { return OBJECT_MAPPER; @@ -58,7 +58,7 @@ public class JsonUtils { * @throws RuntimeException 如果转换过程中发生IO异常,则抛出运行时异常 */ public static T parseObject(String text, Class clazz) { - if (StringUtils.isEmpty(text)) { + if (StrUtil.isEmpty(text)) { return null; } try { @@ -98,7 +98,7 @@ public class JsonUtils { * @throws RuntimeException 如果转换过程中发生IO异常,则抛出运行时异常 */ public static T parseObject(String text, TypeReference typeReference) { - if (StringUtils.isBlank(text)) { + if (StrUtil.isBlank(text)) { return null; } try { @@ -116,7 +116,7 @@ public class JsonUtils { * @throws RuntimeException 如果转换过程中发生IO异常,则抛出运行时异常 */ public static Dict parseMap(String text) { - if (StringUtils.isBlank(text)) { + if (StrUtil.isBlank(text)) { return null; } try { @@ -137,7 +137,7 @@ public class JsonUtils { * @throws RuntimeException 如果转换过程中发生IO异常,则抛出运行时异常 */ public static List parseArrayMap(String text) { - if (StringUtils.isBlank(text)) { + if (StrUtil.isBlank(text)) { return null; } try { @@ -157,7 +157,7 @@ public class JsonUtils { * @throws RuntimeException 如果转换过程中发生IO异常,则抛出运行时异常 */ public static List parseArray(String text, Class clazz) { - if (StringUtils.isEmpty(text)) { + if (StrUtil.isEmpty(text)) { return new ArrayList<>(); } try {