From 1f3fdcdfa7508c3b0e5fc00b93eb7dc3c198cd03 Mon Sep 17 00:00:00 2001 From: Helius <wangdoubleone@gmail.com> Date: Fri, 08 Jul 2022 15:57:01 +0800 Subject: [PATCH] 添加模板解析日志 --- src/main/java/com/xcong/farmer/cms/modules/core/service/impl/CmsCoreServiceImpl.java | 1 + src/main/java/com/xcong/farmer/cms/core/template/TemplateConfiguration.java | 3 +++ src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ReleaseServiceImpl.java | 12 ++++++------ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/xcong/farmer/cms/core/template/TemplateConfiguration.java b/src/main/java/com/xcong/farmer/cms/core/template/TemplateConfiguration.java index 7dbc81c..1c3b7f6 100644 --- a/src/main/java/com/xcong/farmer/cms/core/template/TemplateConfiguration.java +++ b/src/main/java/com/xcong/farmer/cms/core/template/TemplateConfiguration.java @@ -2,6 +2,7 @@ import com.xcong.farmer.cms.core.node.PartNode; import com.xcong.farmer.cms.core.node.Template; +import lombok.extern.slf4j.Slf4j; import org.jsoup.nodes.Document; import java.io.File; @@ -14,6 +15,7 @@ * @author wzy * @date 2022-07-01 **/ +@Slf4j public class TemplateConfiguration extends Configuration{ private TemplateLoader templateLoader; @@ -31,6 +33,7 @@ throw new RuntimeException("TemplateLoader do not able to be null"); } + log.info("解析开始执行--#类型:{}#--#模板名称:{}#--#ID:{}#", map.get("templateType"), templateName, map.get("id")); this.templateLoader.data(map); Template template = template(templateName); template.output(outputPath); diff --git a/src/main/java/com/xcong/farmer/cms/modules/core/service/impl/CmsCoreServiceImpl.java b/src/main/java/com/xcong/farmer/cms/modules/core/service/impl/CmsCoreServiceImpl.java index a405ee4..d368c92 100644 --- a/src/main/java/com/xcong/farmer/cms/modules/core/service/impl/CmsCoreServiceImpl.java +++ b/src/main/java/com/xcong/farmer/cms/modules/core/service/impl/CmsCoreServiceImpl.java @@ -78,6 +78,7 @@ @Override public void indexProcess(@NotNull Map<String, Object> data, String templateName) { + data.put("templateType", "index"); if (StrUtil.isEmpty(templateName)) { templateName = "index.html"; } diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ReleaseServiceImpl.java b/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ReleaseServiceImpl.java index bd1a0ed..c26a72b 100644 --- a/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ReleaseServiceImpl.java +++ b/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ReleaseServiceImpl.java @@ -74,10 +74,15 @@ map.put("templatePath", columnEntity.getPath()); map.put("companyId", companyId); + executor.execute(() -> { + cmsCoreService.columnProcess(map, columnEntity.getListTemplate()); + releaseIndex(companyId); + }); + if (type != 1) { executor.execute(() -> { if (columnEntity.getParentId() == 0L) { - List<ColumnEntity> columns = columnMapper.selectColumnByParentId(columnEntity.getParentId(), companyId, 2); + List<ColumnEntity> columns = columnMapper.selectColumnByParentId(columnEntity.getId(), companyId, 2); if (CollUtil.isNotEmpty(columns)) { for (ColumnEntity column : columns) { map.put("id", column.getId()); @@ -92,11 +97,6 @@ List<Long> ids = articleMapper.selectArticleIdsByColumnId(columnEntity.getId(), companyId, type); cmsCoreService.articlesProcess(map, ids, columnEntity.getArticleTemplate(), columnEntity.getPath()); - releaseIndex(companyId); - }); - - executor.execute(() -> { - cmsCoreService.columnProcess(map, columnEntity.getListTemplate()); releaseIndex(companyId); }); } -- Gitblit v1.9.1