java之@Autowired注入RedisTemplate

1,导入依赖

<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>

2,在启动类上加上注解

@SpringBootApplication
@EnableCaching
public class SellApplication {
	public static void main(String[] args) {
		SpringApplication.run(SellApplication.class, args);
	}
}

你可能感兴趣的:(Java,java,redis)