第一步:
//修改注解为@Resource
@Resource
private RedisTemplate<String, Object> redisTemplate;
第二步:
<!--
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
<version>2.1.3.RELEASE</version>
<scope>compile</scope>
</dependency>
-->
<!--使用该redis依赖-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>