摘要:
@GetMapping("getResourceByConsumer") public APIResponse getResourceByConsumer(String consumerId){ String error = ""; try { List<TReConsumerResource> r 阅读全文
posted @ 2022-09-07 21:53
Ideaway
阅读(343)
评论(0)
推荐(0)
摘要:
Springboot启动后执行方法(4种) 一、注解@PostConstruct 使用注解@PostConstruct是最常见的一种方式,存在的问题是如果执行的方法耗时过长,会导致项目在方法执行期间无法提供服务。 @Component public class StartInit { // // @ 阅读全文
posted @ 2022-09-07 21:51
Ideaway
阅读(2922)
评论(0)
推荐(0)
摘要:
Service @Service @EnableScheduling public class ShareResourceServiceImpl { /** * 定时缓存共享资源到redis */ // @Scheduled(cron = "*/5 * * * * ?")//每五秒钟 // @Sch 阅读全文
posted @ 2022-09-07 21:50
Ideaway
阅读(356)
评论(0)
推荐(0)