| | |
| | | import com.fasterxml.jackson.annotation.PropertyAccessor; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.fasterxml.jackson.databind.jsontype.impl.LaissezFaireSubTypeValidator; |
| | | import com.qianwen.mdc.collect.config.redis.RedisKeySerializer; |
| | | |
| | | import org.springframework.cache.annotation.CachingConfigurerSupport; |
| | | import org.springframework.cache.annotation.EnableCaching; |
| | |
| | | om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL, JsonTypeInfo.As.PROPERTY); |
| | | //om.activateDefaultTyping(LaissezFaireSubTypeValidator.instance, ObjectMapper.DefaultTyping.NON_FINAL,JsonTypeInfo.As.WRAPPER_ARRAY); |
| | | |
| | | |
| | | jacksonSeial.setObjectMapper(om); |
| | | template.setValueSerializer(jacksonSeial); |
| | | template.setKeySerializer(new StringRedisSerializer()); |
| | | |
| | | //new JdkSerializationRedisSerializer(classLoader); |
| | | |
| | | //template.setHashKeySerializer(new StringRedisSerializer()); |
| | | //template.setKeySerializer(new StringRedisSerializer()); //这个注释了1024 |
| | | RedisKeySerializer keySerializer = new RedisKeySerializer(); |
| | | template.setKeySerializer(keySerializer); |
| | | template.setHashKeySerializer(keySerializer); |
| | | |
| | | ClassLoader classLoader = getClass().getClassLoader(); |
| | | template.setHashKeySerializer(new JdkSerializationRedisSerializer(classLoader)); |
| | | |
| | | //ClassLoader classLoader = getClass().getClassLoader(); |
| | | //template.setHashKeySerializer(new JdkSerializationRedisSerializer(classLoader)); |
| | | template.setHashValueSerializer(jacksonSeial); |
| | | template.afterPropertiesSet(); |
| | | return template; |