
任务
木轮丶
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
阿里云OSS对象存储Demo
import com.aliyun.oss.OSS; import com.aliyun.oss.OSSClientBuilder; import com.aliyun.oss.model.CannedAccessControlList; import org.joda.time.DateTime; import org.springframework.stereotype.Service; import java.io.InputStream; import java.util.UUID; /**原创 2021-07-19 09:18:42 · 750 阅读 · 0 评论 -
阿里云短信Demo
/** * 详细内容参考阿里云短信官方文档 * * @param mobile 手机号 * @param templateCode 阿里云官网上的模板名字 * @param param 自定义的参数,内容里包括发送给用户的验证码和信息主体 */ public void send(String mobile, String templateCode, Map<String, Object> param) { //创建远程连接客户端对象,填写访问信息 D原创 2021-07-19 08:57:05 · 402 阅读 · 0 评论 -
SpringBoot 发送邮件
@Test public void test3() throws MessagingException { sendMail(true, "测试封装方法", "<h1 style=\"color:red\"> 测试内容 </h1>", "[email protected]", "[email protected]", "utf-8", "C:\\1.jpg",原创 2021-07-16 10:24:11 · 103 阅读 · 0 评论 -
spring boot 异步任务
Controller层 @RestController public class AsyncController { @Autowired AsyncService asyncService; @RequestMapping("/hello") public String hello() { asyncService.hello(); return "ok!"; } } 实现层 //告诉Spring这是一个异步的方法 @Asyn原创 2021-07-16 10:23:11 · 94 阅读 · 0 评论 -
java 定时任务
TaskScheduler : 任务调度者 TaskExecutor : 任务执行者 @EnableScheduling //开启定时功能的注解,在入口函数的类上声明 @Scheduled //什么时候执行,在方法上加入 Cron表达式: // 秒 分 时 日 月 星期 @Scheduled(cron = "30 16 10 * * ?") public void hello() { System.out.println("hello,你被执行了"); } // 在每天的10点16分30秒执行这个方原创 2021-07-16 10:22:32 · 105 阅读 · 0 评论