From 489b38cff851af79c1908c7493e9025eec87be7c Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Tue, 09 Aug 2022 14:55:54 +0800
Subject: [PATCH] 20220809 最大上传150
---
src/main/java/com/xcong/farmer/cms/core/template/TemplateConfiguration.java | 19 +++++++++++++------
1 files changed, 13 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 dba37a4..22ac0dc 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
@@ -1,7 +1,9 @@
package com.xcong.farmer.cms.core.template;
+import com.xcong.farmer.cms.common.utils.FileUtils;
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 +16,7 @@
* @author wzy
* @date 2022-07-01
**/
+@Slf4j
public class TemplateConfiguration extends Configuration{
private TemplateLoader templateLoader;
@@ -30,24 +33,28 @@
if (this.templateLoader == null) {
throw new RuntimeException("TemplateLoader do not able to be null");
}
+ map.put("apiUrl", API_URL);
+ String companyCode = (String) map.get("companyCode");
+
+ log.info("解析开始执行--#类型:{}#--#模板名称:{}#--#ID:{}#", map.get("templateType"), templateName, map.get("id"));
this.templateLoader.data(map);
- Template template = template(templateName);
- template.output(this.outputPath);
+ Template template = template(FileUtils.path(templatePath, companyCode), templateName);
+ template.output(outputPath);
// 判断是否有分页,有则执行。从第二页开始
int i = 2;
while(Template.HAS_PAGING) {
map.put("page", i);
this.templateLoader.data(map);
- Template pageTemplate = template(templateName);
- pageTemplate.output(this.outputPath);
+ Template pageTemplate = template(FileUtils.path(templatePath, companyCode), templateName);
+ pageTemplate.output(outputPath);
i++;
}
}
- public Template template(String templateName) {
- return template(new File(path(this.templatePath) + templateName));
+ public Template template(String templatePath, String templateName) {
+ return template(new File(path(templatePath) + templateName));
}
public Template template(File file) {
--
Gitblit v1.9.1