package com.xcong.farmer.cms.modules.core.service.impl; import cn.hutool.core.util.StrUtil; import com.xcong.farmer.cms.core.template.TemplateConfiguration; import com.xcong.farmer.cms.modules.core.service.ICmsCoreService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.HashMap; import java.util.Map; /** * @author wzy * @date 2022-07-03 **/ @Slf4j @Service public class CmsCoreServiceImpl implements ICmsCoreService { @Autowired private TemplateConfiguration cfg; @Override public void articleProcess(Long id, String templateName) { Map data = new HashMap<>(); data.put("id", id); data.put("companyId", 23L); if (StrUtil.isEmpty(templateName)) { templateName = "defualt.artile.html"; } cfg.process(data, templateName); } @Override public void columnProcess(Map data, String templateName, boolean article) { data.put("companyId", 23L); if (StrUtil.isEmpty(templateName)) { templateName = "defualt.list.html"; } cfg.process(data, templateName); } }