<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-cache</artifactId> </dependency>
spring: redis: host: 192.168.17.128 port: 6379 database: 0 password: 1234 cache: redis: time-to-live: 1800000
在启动类加上@EnableCaching
---------------------------------------------------------------------------------------------------
将返回结果R对象序列化 implements Serializable