一、导入Maven依赖:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
<version>2.7.3</version>
</dependency>
二、实现思路:
三、代码开发:
@Cacheable(cacheNames = "setmealCache",key = "#categoryId")
文章来源:https://www.toymoban.com/news/detail-677190.html
@CacheEvict(cacheNames = "setmealCache",key = "#setmealDTO.categoryId")//key: setmealCache::100
@CacheEvict(cacheNames = "setmealCache",allEntries = true)
文章来源地址https://www.toymoban.com/news/detail-677190.html
到了这里,关于【springboot】Spring Cache缓存:的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!