1,3 list adding cache and postman test

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

 

Guess you like

Origin www.cnblogs.com/zwyzwy/p/11959617.html