Commit b1844a67 authored by alex yao's avatar alex yao

优化邮箱通知插件

parent 842116de
...@@ -46,14 +46,14 @@ public class NotificationReminderFunction extends AbstractLargeModelFunction { ...@@ -46,14 +46,14 @@ public class NotificationReminderFunction extends AbstractLargeModelFunction {
MemberInfoEntity memberInfoEntity = bizMemberInfoService.getById(userBaseEntity.getUserId().intValue()); MemberInfoEntity memberInfoEntity = bizMemberInfoService.getById(userBaseEntity.getUserId().intValue());
String email = memberInfoEntity.getEmail(); String email = memberInfoEntity.getEmail();
if (StringUtils.isBlank(email)) { if (StringUtils.isBlank(email)) {
return "告知用户插件执行失败,原因是用户需要完善个人邮箱信息后再使用。"; return "Error 【执行失败】: 用户需要完善个人邮箱信息后再使用。";
} }
JSONObject jsonObject = JSONObject.parseObject(content); JSONObject jsonObject = JSONObject.parseObject(content);
jsonObject.put("email", email); jsonObject.put("email", email);
jsonObject.put("sign", UUIDTool.getUUID()); jsonObject.put("sign", UUIDTool.getUUID());
Date date = jsonObject.getDate("datetime"); Date date = jsonObject.getDate("datetime");
if (date.before(DateUtils.getCurrDateTime())) { if (date.before(DateUtils.getCurrDateTime())) {
return "告知用户插件执行失败,原因是通知的日期时间已经超过当前时间。"; return "Error 【执行失败】: 通知的日期时间已经超过当前时间。";
} }
long expiredTime = DateUtils.diffTwoDate(date, DateUtils.getCurrDateTime()) / 1000; long expiredTime = DateUtils.diffTwoDate(date, DateUtils.getCurrDateTime()) / 1000;
redisService.set(NotificationReminderConstant.REDIS_KEY + jsonObject.toJSONString(), null, expiredTime); redisService.set(NotificationReminderConstant.REDIS_KEY + jsonObject.toJSONString(), null, expiredTime);
......
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