1, pom.xml dependency introduced redis
2, profile configuration redis
3, master classes open the cache comment
4, add annotations on methods Service
1 @Cacheable(value="list")//value 后面的值随便写 2 public List<Student> list() { 3 // TODO Auto-generated method stub 4 return studentRepository.findAll(); 5 }
5, serializeble entity class implements an interface, and the software to open redis
6, postman test data