|
|
|
@ -125,7 +125,7 @@ public class Job { |
|
|
|
for (Mail mail : mails) { |
|
|
|
for (Mail mail : mails) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
long timestamp = new Date().getTime(); |
|
|
|
long timestamp = new Date().getTime(); |
|
|
|
HttpResponse httpResponse = HttpUtil.createRequest(Method.PUT, mailboxUrl + "mail/evaluate") |
|
|
|
HttpResponse httpResponse = HttpUtil.createRequest(Method.POST, mailboxUrl + "mail/evaluate") |
|
|
|
.header("timestamp", String.valueOf(timestamp)) |
|
|
|
.header("timestamp", String.valueOf(timestamp)) |
|
|
|
.auth(MD5.create().digestHex(key + timestamp)) |
|
|
|
.auth(MD5.create().digestHex(key + timestamp)) |
|
|
|
.body(JSONObject.of("id", mail.getId(), "satisfaction", mail.getSatisfaction()).toJSONString()) |
|
|
|
.body(JSONObject.of("id", mail.getId(), "satisfaction", mail.getSatisfaction()).toJSONString()) |
|
|
|
@ -158,11 +158,14 @@ public class Job { |
|
|
|
for (SmsSend smsSend : mails) { |
|
|
|
for (SmsSend smsSend : mails) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
long timestamp = new Date().getTime(); |
|
|
|
long timestamp = new Date().getTime(); |
|
|
|
HttpResponse httpResponse = HttpUtil.createRequest(Method.PUT, mailboxUrl + "mail/sms/evaluate") |
|
|
|
String url = mailboxUrl + "mail/sms/evaluate"; |
|
|
|
|
|
|
|
log.info(url); |
|
|
|
|
|
|
|
HttpResponse httpResponse = HttpUtil.createRequest(Method.POST, url) |
|
|
|
.header("timestamp", String.valueOf(timestamp)) |
|
|
|
.header("timestamp", String.valueOf(timestamp)) |
|
|
|
.auth(MD5.create().digestHex(key + timestamp)) |
|
|
|
.auth(MD5.create().digestHex(key + timestamp)) |
|
|
|
.body(JSONObject.of("id", smsSend.getMailId(), "satisfaction", smsSend.getSatisfactionSms()).toJSONString()) |
|
|
|
.body(JSONObject.of("id", smsSend.getMailId(), "satisfaction", smsSend.getSatisfactionSms()).toJSONString()) |
|
|
|
.execute(); |
|
|
|
.execute(); |
|
|
|
|
|
|
|
log.info(httpResponse.body()); |
|
|
|
if (!httpResponse.isOk()) { |
|
|
|
if (!httpResponse.isOk()) { |
|
|
|
throw new RuntimeException(String.format("httpCode: %s", httpResponse.getStatus())); |
|
|
|
throw new RuntimeException(String.format("httpCode: %s", httpResponse.getStatus())); |
|
|
|
} |
|
|
|
} |
|
|
|
|