Commit 7304291c by jx-art

邮箱测试发送~~~

parent 07591178
...@@ -12,6 +12,4 @@ public interface UasClientService { ...@@ -12,6 +12,4 @@ public interface UasClientService {
void sendEmail(String subject, String content, Collection<String> toList, Collection<String> ccList, List<File> fileList); void sendEmail(String subject, String content, Collection<String> toList, Collection<String> ccList, List<File> fileList);
void sendEmail1(String subject, String content, Collection<String> toList, Collection<String> ccList, List<File> fileList);
} }
...@@ -34,6 +34,10 @@ public class IUasClientEhcImpl implements IUasEhcClient { ...@@ -34,6 +34,10 @@ public class IUasClientEhcImpl implements IUasEhcClient {
List<File> fileList) { List<File> fileList) {
if (!CollectionUtils.isEmpty(toList)) { if (!CollectionUtils.isEmpty(toList)) {
Map<String, String> params = new HashMap(); Map<String, String> params = new HashMap();
logger.error("参数查看"+subject);
if (subject == null || subject.equals("")){
subject = "测试标题";
}
params.put("subject", subject); params.put("subject", subject);
params.put("content", content); params.put("content", content);
if (!CollectionUtils.isEmpty(toList)) { if (!CollectionUtils.isEmpty(toList)) {
......
...@@ -56,28 +56,4 @@ public class UasClientServiceImpl implements UasClientService { ...@@ -56,28 +56,4 @@ public class UasClientServiceImpl implements UasClientService {
} }
} }
public void sendEmail1(String subject, String content, Collection<String> toList, Collection<String> ccList, List<File> fileList) {
logger.info("调用接口111~~~~~~~~~~~~~~~~~~~~~~~~");
if (!CollectionUtils.isEmpty(toList)) {
//String url = MessageFormat.format("http://{0}{1}/{2}", this.thirdPartyDrmConfig.getUasHostInner(), "/push/email/", this.thirdPartyDrmConfig.getUasProduct());
Map<String, String> params = new HashMap();
params.put("subject", subject);
params.put("content", content);
params.put("to", StringUtils.join(toList, ","));
params.put("topic", "qc");
if (!CollectionUtils.isEmpty(ccList)) {
params.put("cc", StringUtils.join(ccList, ","));
}
String res = service.sendEmail1(params);
this.logger.info("返回信息日志打印\n"+res);
this.logger.info("[op:sendEmail] res={} ", new Object[]{res});
JSONObject jsonObject = JSON.parseObject(res);
if (jsonObject.getInteger("code") != 200) {
this.logger.error("SendEmail", (String)null, "send email failed, subject={},toList={},ccList={}", new Object[]{subject, JSON.toJSONString(toList), JSON.toJSONString(ccList)});
}
}
}
} }
...@@ -15,13 +15,10 @@ import java.util.Map; ...@@ -15,13 +15,10 @@ import java.util.Map;
public interface EmailRpcService { public interface EmailRpcService {
//templates/flowx/template/assemble.json //templates/flowx/template/assemble.json
//yanxuan-qc-change-system //yanxuan-qc-change-system
@PostMapping("/push/email/attach/yanxuan-qc-change-system/upload.json") //@PostMapping("/push/email/attach/yanxuan-qc-change-system/upload.json")
@PostMapping("/push/email/attach/yxqc_release_flow/upload.json")
String sendEmail(Map<String, String> params); String sendEmail(Map<String, String> params);
@PostMapping("/push/email/yanxuan-qc-change-system/upload.json")
String sendEmail1(Map<String, String> params);
//yanxuan-sc-ehc //yanxuan-sc-ehc
@PostMapping("/push/email/bpm_risk_evaluation_11") @PostMapping("/push/email/bpm_risk_evaluation_11")
String sendEmailInfo(Map<String, String> params); String sendEmailInfo(Map<String, String> params);
......
...@@ -125,30 +125,23 @@ public class ChangeConfigController { ...@@ -125,30 +125,23 @@ public class ChangeConfigController {
logger.info("调用接口~~~~~~~~~~~~~~~~~~~~~~~~"); logger.info("调用接口~~~~~~~~~~~~~~~~~~~~~~~~");
strings.add("wb.tanglongwei@mesg.corp.netease.com"); strings.add("wb.tanglongwei@mesg.corp.netease.com");
iEmailService.sendEmail("测试标题","{\n" + iEmailService.sendEmail("测试标题","{\n" +
" \"headline\" : \"测试标题\",\n" + " \"flowId\":\"工单ID\",\n" +
" \"text\" : \"测试文本内容\"\n" + " \"releaseId\":\"发起人账号\",\n" +
" \"releaseName\":\"发起人姓名\",\n" +
" \"abnormalTitle\":\"异常标题\",\n" +
" \"flowLink\":\"工单链接\",\n" +
" \"findTime\":\"findTime\",\n" +
" \"findDes\":\"findDes\"\n" +
"\n" +
"}", strings,null,null); "}", strings,null,null);
} }
@GetMapping("/test1") @GetMapping("/test1")
public void queryCommanderInfo1(){ public void queryCommanderInfo1(){
ArrayList<String> strings = new ArrayList<>(); ArrayList<String> strings = new ArrayList<>();
logger.info("调用接口~~~~~~~~~~~~~~~~~~~~~~~~"); logger.info("调用接口~~~~~~~~~~~~~~~~~~~~~~~~");
strings.add("wb.tanglongwei@mesg.corp.netease.com"); strings.add("wb.tanglongwei@mesg.corp.netease.com");
iEmailService.sendEmail1("测试标题","{\n" + client.sendEmail("测试标题11","{\n" +
" \"headline\" : \"测试标题\",\n" +
" \"text\" : \"测试文本内容\"\n" +
"}", strings,null,null);
}
@GetMapping("/test2")
public void queryCommanderInfo2(){
ArrayList<String> strings = new ArrayList<>();
logger.info("调用接口~~~~~~~~~~~~~~~~~~~~~~~~");
strings.add("wb.tanglongwei@mesg.corp.netease.com");
client.sendEmail("测试标题","{\n" +
" \"flowId\":\"工单ID\",\n" + " \"flowId\":\"工单ID\",\n" +
" \"releaseId\":\"发起人账号\",\n" + " \"releaseId\":\"发起人账号\",\n" +
" \"releaseName\":\"发起人姓名\",\n" + " \"releaseName\":\"发起人姓名\",\n" +
......
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