From 71cf9852ecc5d77b956d6d3050a7670a46cf3915 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期四, 16 三月 2023 09:18:27 +0800
Subject: [PATCH] 更新前后端分离部署文档
---
src/main/java/com/genersoft/iot/vmp/utils/redis/FastJsonRedisSerializer.java | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/utils/redis/FastJsonRedisSerializer.java b/src/main/java/com/genersoft/iot/vmp/utils/redis/FastJsonRedisSerializer.java
index 81e6249..466a503 100644
--- a/src/main/java/com/genersoft/iot/vmp/utils/redis/FastJsonRedisSerializer.java
+++ b/src/main/java/com/genersoft/iot/vmp/utils/redis/FastJsonRedisSerializer.java
@@ -1,14 +1,12 @@
package com.genersoft.iot.vmp.utils.redis;
-import java.nio.charset.Charset;
-
+import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONReader;
import com.alibaba.fastjson2.JSONWriter;
import org.springframework.data.redis.serializer.RedisSerializer;
import org.springframework.data.redis.serializer.SerializationException;
-import com.alibaba.fastjson2.JSON;
-import com.alibaba.fastjson2.JSONWriter.Feature;
+import java.nio.charset.Charset;
/**
* @description:浣跨敤fastjson瀹炵幇redis鐨勫簭鍒楀寲
@@ -31,7 +29,7 @@
if (t == null) {
return new byte[0];
}
- return JSON.toJSONString(t, JSONWriter.Feature.WriteClassName).getBytes(DEFAULT_CHARSET);
+ return JSON.toJSONString(t, JSONWriter.Feature.WriteClassName, JSONWriter.Feature.WritePairAsJavaBean).getBytes(DEFAULT_CHARSET);
}
@Override
@@ -42,4 +40,6 @@
String str = new String(bytes, DEFAULT_CHARSET);
return JSON.parseObject(str, clazz, JSONReader.Feature.SupportAutoType);
}
+
+
}
--
Gitblit v1.8.0