Helius
2022-07-03 f32a53f5534aa9f9a8591e8b197bb1f8acd9e6c0
src/main/java/com/xcong/farmer/cms/core/template/TemplateConfiguration.java
File was renamed from src/main/java/com/xcong/farmer/cms/cms/template/TemplateConfiguration.java
@@ -1,8 +1,8 @@
package com.xcong.farmer.cms.cms.template;
package com.xcong.farmer.cms.core.template;
import cn.hutool.core.collection.CollUtil;
import com.xcong.farmer.cms.cms.node.PartNode;
import com.xcong.farmer.cms.cms.tag.TagsEnum;
import com.xcong.farmer.cms.core.node.PartNode;
import com.xcong.farmer.cms.core.tag.TagsEnum;
import org.jsoup.nodes.Document;
import java.io.File;
@@ -28,25 +28,15 @@
        this.templateLoader = templateLoader;
    }
    public void process() {
    public void process(Map<String, Object> map, String templateName) {
        if (this.templateLoader == null) {
            throw new RuntimeException("TemplateLoader do not able to be null");
        }
        List<Template> templates = templateLoader.templates();
        if (CollUtil.isEmpty(templates)) {
            return;
        }
        for (Template template : templates) {
            output(template);
        }
        this.templateLoader.data(map);
        output(template(templateName));
    }
    public List<Template> templates() {
        return this.templateLoader.templates();
    }
    public Template template(String templateName) {
        return template(new File(path(this.templatePath) + templateName));
@@ -60,21 +50,14 @@
        return this.templateLoader.template(file);
    }
    public void columnProcess(Long id, String templateName) {
        Template template = template(templateName);
    }
    public void columnProcess(String code, String templateName) {
    }
    public void articleProcess(Long id, String templateName) {
        Map<String, Map<String, Object>> map = new HashMap<>();
        Map<String, Object> data = new HashMap<>();
        data.put("id", id);
        map.put(TagsEnum.ARTICLE.getName(), data);
    }
//    public void columnProcess(Map<String, Object> data, String templateName) {
//        process;
//    }
//
//
//    public void articleProcess(Map<String, Object> data, String templateName) {
//        process(data, templateName);
//    }
    public void output(Template template) {
        Document document = template.getDocument();