![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
任务
木轮丶
这个作者很懒,什么都没留下…
展开
-
阿里云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 · 642 阅读 · 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 · 312 阅读 · 0 评论 -
SpringBoot 发送邮件
@Testpublic void test3() throws MessagingException { sendMail(true, "测试封装方法", "<h1 style=\"color:red\"> 测试内容 </h1>", "1234567@qq.com", "1234567@qq.com", "utf-8", "C:\\1.jpg",原创 2021-07-16 10:24:11 · 70 阅读 · 0 评论 -
spring boot 异步任务
Controller层@RestControllerpublic class AsyncController { @Autowired AsyncService asyncService; @RequestMapping("/hello") public String hello() { asyncService.hello(); return "ok!"; }}实现层//告诉Spring这是一个异步的方法@Asyn原创 2021-07-16 10:23:11 · 58 阅读 · 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 · 55 阅读 · 0 评论