Helius
2022-07-07 2e6277a8cf7a1d78b5151ac42f1aa785205cc907
src/main/java/com/xcong/farmer/cms/modules/core/service/impl/CmsCoreServiceImpl.java
@@ -7,6 +7,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.validation.constraints.NotNull;
import java.util.HashMap;
import java.util.Map;
@@ -22,23 +23,37 @@
    private TemplateConfiguration cfg;
    @Override
    public void articleProcess(Long id, String templateName) {
    public void articleProcess(Long id, String templateName, String templatePath) {
        Map<String, Object> data = new HashMap<>();
        data.put("id", id);
        data.put("companyId", 0L);
        data.put("companyId", 23L);
        data.put("templateType", "article");
        data.put("templatePath", templatePath);
        data.put("templateName", id);
        if (StrUtil.isEmpty(templateName)) {
            templateName = "artile.defualt.html";
            templateName = "defualt.artile.html";
        }
        cfg.process(data, templateName);
    }
    @Override
    public void columnProcess(String code, String templateName, boolean article) {
    public void columnProcess(Map<String, Object> data, String templateName, boolean article) {
        data.put("companyId", 23L);
        data.put("templateType", "column");
        data.put("page", 1);
        if (StrUtil.isEmpty(templateName)) {
            templateName = "defualt.list.html";
        }
        cfg.process(data, templateName);
    }
    @Override
    public void columnProcess(Long id, String templateName, boolean article) {
    public void indexProcess(@NotNull Map<String, Object> data, String templateName) {
        if (StrUtil.isEmpty(templateName)) {
            templateName = "index.html";
        }
        data.put("companyId", 23L);
        cfg.process(data, templateName);
    }
}