Spring Boot 之Redis
Spring Boot对Redis操作进行了封装,其接口为Operations。
使用步骤:
1.增加依赖。(时间有点长)
2.配置属性。(不配不影响使用)
3.配置Spring Boot提供的Redis的封装对象redisTemplate和Cache相关配置。
4.只在service层使用redisTemplate或者将redisTemplate方法封装成service类。
Spring Boot对Redis操作进行了封装,其接口为Operations。
使用步骤:
1.增加依赖。(时间有点长)
2.配置属性。(不配不影响使用)
3.配置Spring Boot提供的Redis的封装对象redisTemplate和Cache相关配置。
4.只在service层使用redisTemplate或者将redisTemplate方法封装成service类。