|
|
|
@ -68,25 +68,6 @@ public class MailServiceImp implements MailService {
|
|
|
|
|
@Value("${app.risk.control.aes-key}")
|
|
|
|
|
private String riskControlAESKey;
|
|
|
|
|
|
|
|
|
|
/* @Override
|
|
|
|
|
public void sendEmail(NoticeBean noticeBean) {
|
|
|
|
|
String url = host + "/mail?" + generateSign(appid, credentialCode, "/mail");
|
|
|
|
|
try {
|
|
|
|
|
HttpRequestResult result = new HttpRequestGenerator(url, RequestMethod.POST).setJSONEntity(noticeBean).execute();
|
|
|
|
|
} catch (URISyntaxException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private String generateSign(String appid, String credentialCode, String url) {
|
|
|
|
|
long time = System.currentTimeMillis();
|
|
|
|
|
String nonceStr = RandomStringUtils.random(15, true, true);
|
|
|
|
|
String validStr = time + "&" + nonceStr + "&" + credentialCode + "&" + url;
|
|
|
|
|
String sign = DigestUtils.sha256Hex(validStr).toLowerCase();
|
|
|
|
|
return "appid=" + appid + "&time=" + time + "&nonce_str=" + nonceStr + "&sign=" + sign;
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String sendEmailNotice(String notice_id, String title, List<JSONObject> mailTo, String content) throws URISyntaxException, IOException {
|
|
|
|
@ -179,7 +160,7 @@ public class MailServiceImp implements MailService {
|
|
|
|
|
noticeBean.setPassword(mailPwd);
|
|
|
|
|
String postUrl = mailHost + "/mail/single?" + generateMailSignParam();
|
|
|
|
|
HttpRequestResult result = null;
|
|
|
|
|
logger.info("===sendEmail===noticeBean:" + JSON.toJSON(noticeBean));
|
|
|
|
|
logger.info("===sendEmail===noticeBean:{}", JSON.toJSON(noticeBean));
|
|
|
|
|
result = new HttpRequestGenerator(postUrl, RequestMethod.POST).setJSONEntity(noticeBean).setTimeout(60_000).execute();
|
|
|
|
|
if (result.isSuccess()) {
|
|
|
|
|
String mail_id = result.getResponseContentJSONObj().getString("mail_id");
|
|
|
|
|