springboot--任务(异步任务--邮件任务--定时任务)
异步任务只需要添加一个注解,让容器知道这是异步任务即可import org.springframework.scheduling.annotation.Async;import org.springframework.stereotype.Service;@Servicepublic class AsyncService { //告诉spring这是异步方法 @Async public void hello(){ System.out.println("
原创
2020-09-06 18:02:45 ·
125 阅读 ·
0 评论