mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-19 01:48:47 +08:00
pom优化,让其更独立
This commit is contained in:
parent
61c6fb11f8
commit
88de9c2447
@ -16,9 +16,26 @@
|
|||||||
</description>
|
</description>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<!-- SpringWeb模块 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dromara</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
<artifactId>ruoyi-common-core</artifactId>
|
<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>
|
</dependency>
|
||||||
|
|
||||||
<!-- JSON工具类 -->
|
<!-- JSON工具类 -->
|
||||||
|
|||||||
@ -3,14 +3,14 @@ package org.dromara.common.json.utils;
|
|||||||
import cn.hutool.core.lang.Dict;
|
import cn.hutool.core.lang.Dict;
|
||||||
import cn.hutool.core.util.ArrayUtil;
|
import cn.hutool.core.util.ArrayUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
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.JsonProcessingException;
|
||||||
import com.fasterxml.jackson.core.type.TypeReference;
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.fasterxml.jackson.databind.exc.MismatchedInputException;
|
import com.fasterxml.jackson.databind.exc.MismatchedInputException;
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import org.dromara.common.core.utils.SpringUtils;
|
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -24,7 +24,7 @@ import java.util.List;
|
|||||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||||
public class JsonUtils {
|
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() {
|
public static ObjectMapper getObjectMapper() {
|
||||||
return OBJECT_MAPPER;
|
return OBJECT_MAPPER;
|
||||||
@ -58,7 +58,7 @@ public class JsonUtils {
|
|||||||
* @throws RuntimeException 如果转换过程中发生IO异常,则抛出运行时异常
|
* @throws RuntimeException 如果转换过程中发生IO异常,则抛出运行时异常
|
||||||
*/
|
*/
|
||||||
public static <T> T parseObject(String text, Class<T> clazz) {
|
public static <T> T parseObject(String text, Class<T> clazz) {
|
||||||
if (StringUtils.isEmpty(text)) {
|
if (StrUtil.isEmpty(text)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@ -98,7 +98,7 @@ public class JsonUtils {
|
|||||||
* @throws RuntimeException 如果转换过程中发生IO异常,则抛出运行时异常
|
* @throws RuntimeException 如果转换过程中发生IO异常,则抛出运行时异常
|
||||||
*/
|
*/
|
||||||
public static <T> T parseObject(String text, TypeReference<T> typeReference) {
|
public static <T> T parseObject(String text, TypeReference<T> typeReference) {
|
||||||
if (StringUtils.isBlank(text)) {
|
if (StrUtil.isBlank(text)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@ -116,7 +116,7 @@ public class JsonUtils {
|
|||||||
* @throws RuntimeException 如果转换过程中发生IO异常,则抛出运行时异常
|
* @throws RuntimeException 如果转换过程中发生IO异常,则抛出运行时异常
|
||||||
*/
|
*/
|
||||||
public static Dict parseMap(String text) {
|
public static Dict parseMap(String text) {
|
||||||
if (StringUtils.isBlank(text)) {
|
if (StrUtil.isBlank(text)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@ -137,7 +137,7 @@ public class JsonUtils {
|
|||||||
* @throws RuntimeException 如果转换过程中发生IO异常,则抛出运行时异常
|
* @throws RuntimeException 如果转换过程中发生IO异常,则抛出运行时异常
|
||||||
*/
|
*/
|
||||||
public static List<Dict> parseArrayMap(String text) {
|
public static List<Dict> parseArrayMap(String text) {
|
||||||
if (StringUtils.isBlank(text)) {
|
if (StrUtil.isBlank(text)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@ -157,7 +157,7 @@ public class JsonUtils {
|
|||||||
* @throws RuntimeException 如果转换过程中发生IO异常,则抛出运行时异常
|
* @throws RuntimeException 如果转换过程中发生IO异常,则抛出运行时异常
|
||||||
*/
|
*/
|
||||||
public static <T> List<T> parseArray(String text, Class<T> clazz) {
|
public static <T> List<T> parseArray(String text, Class<T> clazz) {
|
||||||
if (StringUtils.isEmpty(text)) {
|
if (StrUtil.isEmpty(text)) {
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user