异步任务
1、在启动类添加@EnableAsync
,表示 开启异步注解功能
1 |
|
3、在Controller中直接调用即可
邮件发送
1、导入依赖
1 | <dependency> |
2、打开邮箱的POP3/SMTP服务获取授权码,设置->账户->开启pop3和smtp服务
3、编写配置文件
1 |
|
1、在启动类添加@EnableAsync
,表示 开启异步注解功能
1 | @Service |
3、在Controller中直接调用即可
1、导入依赖
1 | <dependency> |
2、打开邮箱的POP3/SMTP服务获取授权码,设置->账户->开启pop3和smtp服务
3、编写配置文件
1 | @RestController |