替换带代码里所有 fastjson 的内容,统一使用 jackson

不考虑使用 gson 的原因,是基本停止了维护
This commit is contained in:
YunaiV
2021-01-24 12:15:59 +08:00
parent 9c1c265993
commit eadc4f749a
17 changed files with 106 additions and 131 deletions

View File

@@ -1,7 +1,6 @@
package cn.iocoder.dashboard.framework.redis.config;
import cn.iocoder.dashboard.framework.redis.core.pubsub.AbstractChannelMessageListener;
import com.alibaba.fastjson.support.spring.GenericFastJsonRedisSerializer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -29,7 +28,7 @@ public class RedisConfig {
// 使用 String 序列化方式,序列化 KEY 。
template.setKeySerializer(RedisSerializer.string());
// 使用 JSON 序列化方式(库是 FastJSON ),序列化 VALUE 。
template.setValueSerializer(new GenericFastJsonRedisSerializer());
template.setValueSerializer(RedisSerializer.json());
return template;
}

View File

@@ -1,6 +1,6 @@
package cn.iocoder.dashboard.framework.redis.core.pubsub;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
/**
* Redis Channel Message 接口
@@ -12,7 +12,7 @@ public interface ChannelMessage {
*
* @return Channel
*/
@JSONField(serialize = false) // 必须序列化
@JsonIgnore // 必须序列化
String getChannel();
}