![](https://img-blog.csdnimg.cn/20190927151026427.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
Spring注解
Spring注解
逆势生长
无法将我毁灭,则必将使我强大
展开
-
@Cacheable注解使用 - 缓存查询数据
@Cacheable既作用在方法上,也就用在类上。当作用在方法上是只对该方法有用,作用在类上时,对该类的所有方法都有效。 示例: controller: @GetMapping("test_cache") public String testCache(@RequestParam String flag){ String s = countryService.testCache(flag); return s; } service: S.原创 2020-07-31 23:59:07 · 2560 阅读 · 4 评论 -
@Async 注解使用小例子
@Target({ElementType.TYPE, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface Async { String value() default ""; } @Async 用于异步调用,由上面源码可知:原创 2020-07-31 23:43:47 · 492 阅读 · 0 评论