![24b6621a4a9e0f228e14777940e2f6ad.gif](https://i-blog.csdnimg.cn/blog_migrate/0f93a3881b8c60028818d137ee81502c.gif)
喜欢就关注我们吧!
一、引言
最近看到一篇用js代码实现表白的文章,深有感触。
然后发现自己也可以用java代码实现,然后就开始写代码了,发现还挺有意思的,话不多说开搞
实现思路:
使用HttpClient远程获取彩虹屁生成器网站中的内容 网站:https://chp.shadiao.app/
java Mail 实现发送邮件
SpringBoot 整合Scheduled 实现定时发送邮件
二、搭建项目
项目环境在SpringBoot框架基础上,加入邮件发送mail、RPC远程调用httpclient、Scheduled 的一个Maven项目,依赖如下:
`<parent>
<groupId>org.springframework.bootgroupId>
<artifactId>spring-boot-starter-parentartifactId>
<version>2.3.2.RELEASEversion>
parent>
<dependencies>
<dependency>
<groupId>org.springframework.bootgroupId>
<artifactId>spring-boot-starter-mailartifactId>
dependency>
<dependency>
<groupId>org.springframeworkgroupId>
<artifactId>spring-context-supportartifactId>
dependency>
<dependency>
<groupId>org.apache.httpcomponentsgroupId>
<artifactId>httpclientartifactId>
<version>4.5.12version>
dependency>
dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.bootgroupId>