默认序列化器

RedisSerializer stringSerializer = new StringRedisSerializer();
redisTemplate.setKeySerializer(stringSerializer);
redisTemplate.setValueSerializer(new Jackson2JsonRedisSerializer<>(Object.class));
redisTemplate.setHashKeySerializer(stringSerializer);
redisTemplate.setHashValueSerializer(new Jackson2JsonRedisSerializer<>(Object.class));

参考地址:

https://blog.csdn.net/u010096624/article/details/109046714