|
|
@@ -69,20 +69,22 @@ public class HomeController extends BaseController { |
|
|
@Autowired |
|
|
@Autowired |
|
|
private MqBaseProducer mqBaseProducer; |
|
|
private MqBaseProducer mqBaseProducer; |
|
|
|
|
|
|
|
|
@ApiOperation("发送邮件") |
|
|
|
|
|
@GetMapping("test") |
|
|
|
|
|
public ResultData test() throws Exception { |
|
|
|
|
|
String msg = "<!DOCTYPEhtml><html><head><metacharset=\"utf-8\"><metaname=\"viewport\"content=\"width=device-width,initial-scale=1.0\"><metahttp-equiv=\"Content-Type\"content=\"text/html; charset=utf-8\"/><metaname=\"viewport\"content=\"initial-scale=1.0, user-scalable=no\"/><metaname=\"renderer\"content=\"webkit\"><metahttp-equiv=\"X-UA-Compatible\"content=\"IE=edge,chrome=1\"><title>富茂审批邮件</title><title></title><script>document.documentElement.style.fontSize=document.documentElement.clientWidth/7.5+'px';</script></head><body><divid=\"box\"><headerstyle=\"height:140px;width:100%;display:flex;background:rgba(31,47,62,1);border-radius:15px 15px 0px 0px;\"><imgstyle=\"height:auto;width:292px;display:flex;align-self: center;justify-content: center;margin-left: 40px;\"src=\"https://s3.cn-northwest-1.amazonaws.com.cn/iformall-net/cimg/changrong-logo.png\"/></header><content><divstyle=\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;margin-top: 56px;margin-left: 55px;\">审批通过通知</div><divstyle=\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);margin-left: 55px;margin-top: 36px;\">编号<span>123231232323</span>的合同已经审批通过,请登录,<ahref=\"http://mall.youlane.cn\">长融后台</a>跟进后续工作</div></content></div></body></html>"; |
|
|
|
|
|
MailMsg mailMsg = new MailMsg(); |
|
|
|
|
|
mailMsg.setHtml(true); |
|
|
|
|
|
mailMsg.setFrom("luozukai1988@126.com"); |
|
|
|
|
|
mailMsg.setTo(new String[]{"luozukai@iformall.com"}); |
|
|
|
|
|
mailMsg.setSubject("富茂测试邮件"); |
|
|
|
|
|
mailMsg.setMsgType(EnumMsgRecordType.EMAIL.getCode()); |
|
|
|
|
|
mailMsg.setMsg(msg); |
|
|
|
|
|
mqBaseProducer.sendMessage(mailMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode()); |
|
|
|
|
|
return new ResultData(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// @ApiOperation("发送邮件") |
|
|
|
|
|
// @GetMapping("test") |
|
|
|
|
|
// public ResultData test() throws Exception { |
|
|
|
|
|
// String msg = "<!DOCTYPE html><html><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0\"><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /><meta name=\"viewport\" content=\"initial-scale=1.0, user-scalable=no\" /><meta name=\"renderer\" content=\"webkit\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\"><title>富茂审批邮件</title><title></title><script> document.documentElement.style.fontSize = document.documentElement.clientWidth / 7.5 + 'px';</script></head>\n" + |
|
|
|
|
|
// "<body><div id=\"box\"><header style=\"height:140px;width:100%;display:flex;background:rgba(31,47,62,1);border-radius:15px 15px 0px 0px;\"><img style=\"height:auto;width:292px;display:flex;align-self: center;justify-content: center;margin-left: 40px;\" src=\"https://s3.cn-northwest-1.amazonaws.com.cn/iformall-net/cimg/changrong-logo.png\"/>\n" + |
|
|
|
|
|
// "</header><content><div style=\"font-size:26px;font-family:MicrosoftYaHei-Bold;font-weight:bold;color:rgba(85,85,85,1);line-height: 32px;margin-top: 56px;margin-left: 55px;\">审批通过通知</div><div style=\"font-size:18px;font-family:MicrosoftYaHei;font-weight:400;color:rgba(85,85,85,1);margin-left: 55px;margin-top: 36px;\">编号<span>123231232323</span>的合同已经审批通过,请登录,<a href=\"http://mall.youlane.cn\">长融后台</a>跟进后续工作</div></content></div></body></html>"; |
|
|
|
|
|
// MailMsg mailMsg = new MailMsg(); |
|
|
|
|
|
// mailMsg.setHtml(true); |
|
|
|
|
|
// mailMsg.setFrom("luozukai1988@126.com"); |
|
|
|
|
|
// mailMsg.setTo(new String[]{"luozukai@iformall.com"}); |
|
|
|
|
|
// mailMsg.setSubject("富茂测试邮件"); |
|
|
|
|
|
// mailMsg.setMsgType(EnumMsgRecordType.EMAIL.getCode()); |
|
|
|
|
|
// mailMsg.setMsg(msg); |
|
|
|
|
|
// mqBaseProducer.sendMessage(mailMsg, EnumMsgMqTopic.DEFAULT.getCode(), EnumMsgMqTag.DEFAULT.getCode(),EnumMsgMqKey.DEFAULT.getCode()); |
|
|
|
|
|
// return new ResultData(); |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
@GetMapping("/captcha.jpg") |
|
|
@GetMapping("/captcha.jpg") |
|
|
public void captcha(HttpServletResponse response)throws ServletException, IOException { |
|
|
public void captcha(HttpServletResponse response)throws ServletException, IOException { |
|
|
|