fix 修复 fm模板将Long类型格式化出现问题

This commit is contained in:
疯狂的狮子Li
2026-06-25 09:30:11 +08:00
parent 1d263f7656
commit 3cf2eceb13
@@ -62,6 +62,10 @@ public class TemplateEngineUtils {
TemplateConfig templateConfig = new TemplateConfig(StandardCharsets.UTF_8, StringUtils.EMPTY, TemplateConfig.ResourceMode.CLASSPATH);
templateConfig.setCustomEngine(FreemarkerEngine.class);
TEMPLATE_ENGINE = TemplateUtil.createEngine(templateConfig);
// 禁用数字千分位格式化 避免 Long 类型的 ID 渲染是被加上逗号
if (TEMPLATE_ENGINE instanceof FreemarkerEngine freemarkerEngine) {
freemarkerEngine.getConfiguration().setNumberFormat("computer");
}
TEMPLATE_MAPPER = PathNamedTemplate.form(TEMPLATE_ENGINE, GenConstants.TEMPLATE_PATHS);
}