Commit f49b1bed authored by fangxinjiang's avatar fangxinjiang

批量办理调优

parent 1fdfdd9e
......@@ -18,8 +18,11 @@
package com.yifu.cloud.plus.v1.mail.controller;
import com.yifu.cloud.plus.v1.mail.service.MailService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -41,11 +44,10 @@ public class MailController {
* 邮件发送服务
* @return
*/
/* @Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/page" )
public R getTCheckMobilePage(Page page, TCheckMobile tCheckMobile) {
return R.ok(tCheckMobileService.page(page, Wrappers.query(tCheckMobile)));
@Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/sendMail" )
public R getTCheckMobilePage() {
return R.ok(mailService.sendMail(null));
}
*/
}
......@@ -2,6 +2,9 @@ package com.yifu.cloud.plus.v1.mail.service.impl;
import com.sun.xml.internal.ws.resources.SenderMessages;
import com.yifu.cloud.plus.v1.mail.service.MailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.stereotype.Service;
/**
......@@ -11,9 +14,18 @@ import org.springframework.stereotype.Service;
**/
@Service("mailService")
public class MailServiceImpl implements MailService {
@Autowired
private JavaMailSender mailSender;
@Override
public Boolean sendMail(SenderMessages messages) {
SimpleMailMessage mailMessage = new SimpleMailMessage();
mailMessage.setFrom("fangxinjiang@wanxin-holdings.com");
mailMessage.setTo("fangxinjiang@wanxin-holdings.com");
mailMessage.setText("你好 hello world");
mailMessage.setSubject("测试Spring邮箱服务");
mailSender.send(mailMessage);
System.out.println("====完成发送!====");
return null;
}
}
......@@ -10,7 +10,7 @@ spring:
host: 127.0.0.1
password: '@yf_2017'
mail:
host: smtp.exmail.qq.com
host: smtp.wanxin-holdings.com
port: 465
username: information@wanxin-holdings.com
password: QmdCaQSPmCAQEddd
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment