...
|
...
|
@@ -3,6 +3,7 @@ package com.yoho.search.cache.beans; |
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
|
|
import com.yoho.core.redis.cluster.operations.serializer.RedisKeyBuilder;
|
|
|
import com.yoho.search.base.utils.MD5Util;
|
|
|
import com.yoho.search.cache.model.CacheObject;
|
...
|
...
|
@@ -125,7 +126,7 @@ public class SearchCacheService { |
|
|
|
|
|
public <T> void addSerializableObjectToCache(SearchCache searchCache, RedisKeyBuilder redisKeyBuilder, T object, boolean useJsonSerializable) {
|
|
|
if (useJsonSerializable) {
|
|
|
String jsonStr = JSON.toJSONString(object);
|
|
|
String jsonStr = JSON.toJSONString(object,SerializerFeature.WriteMapNullValue,SerializerFeature.DisableCircularReferenceDetect);
|
|
|
this.addObjectToCache(redisKeyBuilder, jsonStr, searchCache);
|
|
|
} else {
|
|
|
this.addObjectToCache(redisKeyBuilder, object, searchCache);
|
...
|
...
|
|