mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2025-09-08 05:17:42 +00:00
update 优化 redis 序列化 使用系统自带json工具 全局统一
This commit is contained in:
@@ -23,6 +23,10 @@ public class JsonUtils {
|
||||
|
||||
private static ObjectMapper OBJECT_MAPPER = SpringUtils.getBean(ObjectMapper.class);
|
||||
|
||||
public static ObjectMapper getObjectMapper() {
|
||||
return OBJECT_MAPPER;
|
||||
}
|
||||
|
||||
public static String toJsonString(Object object) {
|
||||
if (ObjectUtil.isNull(object)) {
|
||||
return null;
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package com.ruoyi.common.redis.config;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.ruoyi.common.core.utils.JsonUtils;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.ruoyi.common.redis.config.properties.RedissonProperties;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -58,7 +59,7 @@ public class RedisConfiguration extends CachingConfigurerSupport {
|
||||
Config config = new Config();
|
||||
config.setThreads(redissonProperties.getThreads())
|
||||
.setNettyThreads(redissonProperties.getNettyThreads())
|
||||
.setCodec(JsonJacksonCodec.INSTANCE);
|
||||
.setCodec(new JsonJacksonCodec(JsonUtils.getObjectMapper()));
|
||||
|
||||
RedissonProperties.SingleServerConfig singleServerConfig = redissonProperties.getSingleServerConfig();
|
||||
if (ObjectUtil.isNotNull(singleServerConfig)) {
|
||||
|
Reference in New Issue
Block a user