springboot 缓存

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>


@Cacheable(value = "value1", key = "#p0+#p1")
List<A> getAs(String param1, String param2){...}

@CacheEvict(value = {"value1"}, allEntries = true)
void updateA(String param3){...}


@SpringBootApplication
@EnableCaching
public class Application {

}

猜你喜欢

转载自www.cnblogs.com/white-knight/p/8962922.html