摘要: 新知识点,@Scheduled, 作用:可以通过@Scheduled配置定时任务。 1 package com.example.demo.scheduled; 2 3 import java.time.LocalDateTime; 4 import java.time.format.DateTime 阅读全文
posted @ 2019-08-13 23:17 明镜小生 阅读(1659) 评论(0) 推荐(0) 编辑
摘要: 今天遇到一个新的知识点,ApplicationRunner。 作用:在springBoot启动完毕后,调用实现了ApplicationRunner接口的run方法。 最终结果: 备注:最开始测试的时候,失败了,没有注意把这个类,添加到spring容器中,后来添加了注释@Component就成功了。 阅读全文
posted @ 2019-08-13 22:54 明镜小生 阅读(897) 评论(0) 推荐(0) 编辑