springboot中redis的使用 一、springboot整合redis 1.1 基本使用 1、导入依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> 2、添加redis配置 spring.redis.password=123456 此时已经可以在代码中使用redisTemplate对象了。例如: @Service public class DepartmentServiceImpl implements DepartmentService { @Resource private DepartmentDAO departmentDAO; @Resource private RedisTemplate redisTemplate; @Override public List<Department> findAll() { ObjectMapper mapper = new...