测试模块

v1.4.1
Parker 4 years ago
parent efe5bffccf
commit 1cafe91eda

@ -3,14 +3,21 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<artifactId>opsli-modulars</artifactId>
<groupId>org.opsliframework.boot</groupId> <groupId>org.opsliframework.boot</groupId>
<artifactId>opsli-boot-parent</artifactId>
<version>1.0.0</version> <version>1.0.0</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>opsli-modulars-test</artifactId> <artifactId>opsli-modulars-test</artifactId>
<version>${project.parent.version}</version> <version>${project.parent.version}</version>
<dependencies>
<!-- 引入邮件插件 -->
<dependency>
<groupId>org.opsliframework.boot</groupId>
<artifactId>opsli-plugins-mail</artifactId>
</dependency>
</dependencies>
</project> </project>

@ -0,0 +1,36 @@
package org.opsli.modulars.test.web;
import org.opsli.common.api.ResultVo;
import org.opsli.common.base.concroller.BaseController;
import org.opsli.plugins.mail.MailHandler;
import org.opsli.plugins.mail.model.MailModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @BelongsProject: opsli-boot
* @BelongsPackage: org.opsli.modulars.test.web
* @Author: Parker
* @CreateTime: 2020-09-13 17:40
* @Description:
*/
@RestController
@RequestMapping("/{opsli.prefix}/{opsli.version}/test")
public class TestRestController extends BaseController {
@Autowired
private MailHandler mailHandler;
@GetMapping("/sendMail")
public ResultVo sendMail(){
MailModel mailModel = new MailModel();
mailModel.setTo("meet.carina@foxmail.com");
mailModel.setSubject("测试邮件功能");
mailModel.setContent("<h1>这是哪里呢?</h1><br><font color='red'>lalalalalalallalalalalal!!!!</font>");
mailHandler.send(mailModel);
return ResultVo.success("发送邮件成功!!!!!!");
}
}
Loading…
Cancel
Save