pom优化,让其更独立

This commit is contained in:
lizhengwei 2025-12-01 14:13:55 +08:00
parent 61c6fb11f8
commit 88de9c2447
2 changed files with 27 additions and 10 deletions

View File

@ -16,9 +16,26 @@
</description>
<dependencies>
<!-- SpringWeb模块 -->
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-common-core</artifactId>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-core</artifactId>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-extra</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<!-- JSON工具类 -->

View File

@ -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> T parseObject(String text, Class<T> 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> T parseObject(String text, TypeReference<T> 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<Dict> 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 <T> List<T> parseArray(String text, Class<T> clazz) {
if (StringUtils.isEmpty(text)) {
if (StrUtil.isEmpty(text)) {
return new ArrayList<>();
}
try {