freemarker 默认值

This commit is contained in:
ran.shang
2025-06-26 18:30:09 +08:00
parent b622782415
commit 161076e755
2 changed files with 4 additions and 0 deletions

View File

@@ -29,6 +29,7 @@ public class FreeMarkerTemplateUtils {
CONFIGURATION.setDefaultEncoding("UTF-8");
CONFIGURATION.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
CONFIGURATION.setCacheStorage(NullCacheStorage.INSTANCE);
CONFIGURATION.setClassicCompatible(true);
}
public static Template getTemplate(String templateName) throws IOException {

View File

@@ -1,5 +1,6 @@
package com.newyetai.usercenter.notice.service.impl;
import com.newyetai.common.util.DateUtils;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -129,6 +130,8 @@ public class NoticeSendRecordServiceImpl implements NoticeSendRecordService {
log.error("无对应消息通道处理...");
}
Set<Long> receiverUserIds = noticeSendRecordOperateDTO.getReceiverUserIds();
// 内置发送时间
noticeSendRecordOperateDTO.getContentParamDataMap().put("defaultSendDay", DateUtils.getCurrentYmd());
NoticeSendRecordDTO noticeSendRecordDTO =
NoticeSendRecordDTO.builder().templateId(noticeSendRecordOperateDTO.getTemplateId())
.senderOrgId(noticeSendRecordOperateDTO.getOperateOrgId())