| | |
| | | |
| | | public static String path(String path, String fileName) { |
| | | File file = new File(path); |
| | | if (!file.isDirectory()){ |
| | | if (file.exists() && !file.isDirectory()){ |
| | | return ""; |
| | | } |
| | | |
| | | if (!file.exists()) { |
| | | file.mkdirs(); |
| | | } |
| | | |
| | | String dir = path(path); |
| | | return dir + fileName; |
| | | } |
| | |
| | | import com.xcong.farmer.cms.configurations.properties.CmsProperties; |
| | | import com.xcong.farmer.cms.core.template.TemplateConfiguration; |
| | | import com.xcong.farmer.cms.core.template.TemplateLoader; |
| | | import com.xcong.farmer.cms.modules.system.entity.DataDictionaryCustom; |
| | | import com.xcong.farmer.cms.modules.system.mapper.DataDictionaryCustomMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author wzy |
| | |
| | | @Bean |
| | | public TemplateConfiguration templateConfiguration() { |
| | | log.info("CMS管理系统"); |
| | | TemplateConfiguration cfg = new TemplateConfiguration(cmsProperties.getTemplatePath(), cmsProperties.getStaticPath(), cmsProperties.getOutputPath(), cmsProperties.getBaseUrl(), cmsProperties.getStaticUrl()); |
| | | |
| | | TemplateConfiguration cfg = new TemplateConfiguration(cmsProperties.getTemplatePath(), cmsProperties.getStaticPath(), cmsProperties.getOutputPath(), cmsProperties.getApiUrl(), cmsProperties.getStaticUrl()); |
| | | TemplateLoader loader = new TemplateLoader(cfg); |
| | | cfg.templateLoader(loader); |
| | | return cfg; |
| | |
| | | import lombok.Data; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Data |
| | | @Configuration |
| | | @ConfigurationProperties(prefix = "cms") |
| | | public class CmsProperties { |
| | | |
| | | /** |
| | | * 模板保存地址 |
| | | */ |
| | | private String templatePath; |
| | | |
| | | /** |
| | | * 静态文件保存地址 |
| | | */ |
| | | private String staticPath; |
| | | |
| | | /** |
| | | * html输出地址 |
| | | */ |
| | | private String outputPath; |
| | | |
| | | /** |
| | | * 静态文件访问地址 |
| | | */ |
| | | private String staticUrl; |
| | | |
| | | private String baseUrl; |
| | | /** |
| | | * api请求地址 |
| | | */ |
| | | private String apiUrl; |
| | | } |
| | |
| | | public class ArticleDataParserHandler implements DataParserHandler { |
| | | |
| | | private final ArticleMapper articleMapper = SpringContextHolder.getBean(ArticleMapper.class); |
| | | private final CmsProperties cmsProperties = SpringContextHolder.getBean(CmsProperties.class); |
| | | @Override |
| | | public void dataParser(AttrNode node) { |
| | | log.info("######文章解析########"); |
| | | String baseUrl = (String) node.getSystemDataValue("baseUrl"); |
| | | |
| | | Article tag = (Article) node.getParam(); |
| | | ArticleEntity data = articleMapper.selectById(tag.getId()); |
| | | |
| | |
| | | if (prevEntity.getType() == 2) { |
| | | prev.setUrl(prevEntity.getArticleUrl()); |
| | | } else { |
| | | prev.setUrl(cmsProperties.getBaseUrl() + prevEntity.getPath() + "/" + prevEntity.getId() + ".html"); |
| | | prev.setUrl(baseUrl + prevEntity.getPath() + "/" + prevEntity.getId() + ".html"); |
| | | } |
| | | |
| | | articleData.setPrev(prev); |
| | |
| | | if (nextEntity.getType() == 2) { |
| | | next.setUrl(nextEntity.getArticleUrl()); |
| | | } else { |
| | | next.setUrl(cmsProperties.getBaseUrl() + nextEntity.getPath() + "/" + nextEntity.getId() + ".html"); |
| | | next.setUrl(baseUrl + nextEntity.getPath() + "/" + nextEntity.getId() + ".html"); |
| | | } |
| | | |
| | | articleData.setNext(next); |
| | |
| | | public class ArticlesDataParserHandler implements DataParserHandler { |
| | | |
| | | private ArticleMapper articleMapper = SpringContextHolder.getBean(ArticleMapper.class); |
| | | private CmsProperties cmsProperties = SpringContextHolder.getBean(CmsProperties.class); |
| | | |
| | | @Override |
| | | public void dataParser(AttrNode node) { |
| | | log.info("文章列表解析"); |
| | | Long companyId = (Long) node.getSystemDataValue("companyId"); |
| | | String companyCode = (String) node.getSystemDataValue("companyCode"); |
| | | String baseUrl = (String) node.getSystemDataValue("baseUrl"); |
| | | |
| | | Articles param = (Articles) node.getParam(); |
| | | ArticleEntity article = new ArticleEntity(); |
| | | Page<ArticleEntity> page = new Page<>(Integer.parseInt(param.getPage()), Integer.parseInt(param.getLimit())); |
| | |
| | | |
| | | List<ArticleData> list = new ArrayList<>(); |
| | | for (ArticleEntity record : listPage.getRecords()) { |
| | | ArticleData articleData = entityToData(record); |
| | | ArticleData articleData = entityToData(record, baseUrl + companyCode); |
| | | list.add(articleData); |
| | | } |
| | | |
| | | node.setData(list); |
| | | } |
| | | |
| | | public ArticleData entityToData(ArticleEntity article) { |
| | | public ArticleData entityToData(ArticleEntity article, String baseUrl) { |
| | | ArticleData articleData = ArticleConversion.INSTANCE.entityToData(article); |
| | | |
| | | if (article.getType() == 2) { |
| | | articleData.setUrl(article.getArticleUrl()); |
| | | } else { |
| | | articleData.setUrl(cmsProperties.getBaseUrl() + article.getPath() + "/" + article.getId() + ".html"); |
| | | articleData.setUrl(baseUrl + article.getPath() + "/" + article.getId() + ".html"); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | private ColumnMapper columnMapper = SpringContextHolder.getBean(ColumnMapper.class); |
| | | private ArticleMapper articleMapper = SpringContextHolder.getBean(ArticleMapper.class); |
| | | private CmsProperties cmsProperties = SpringContextHolder.getBean(CmsProperties.class); |
| | | |
| | | private String baseUrl = ""; |
| | | @Override |
| | | public void dataParser(AttrNode attrNode) { |
| | | log.info("栏目解析"); |
| | | Long companyId = (Long) attrNode.getSystemDataValue("companyId"); |
| | | baseUrl = (String) attrNode.getSystemDataValue("baseUrl"); |
| | | |
| | | Column param = (Column) attrNode.getParam(); |
| | | |
| | |
| | | public ColumnData columnToData(ColumnEntity column) { |
| | | ColumnData columnData = ColumnConversion.INSTANCE.entityToData(column); |
| | | |
| | | columnData.setUrl(cmsProperties.getBaseUrl() + column.getPath()); |
| | | columnData.setUrl(baseUrl + column.getPath()); |
| | | if (column.getType() == 2) { |
| | | if (column.getTargetType() == 1) { |
| | | ArticleEntity article = this.articleMapper.selectArticleById(Long.parseLong(column.getTargetUrl())); |
| | | columnData.setUrl(cmsProperties.getBaseUrl() + article.getPath() + "/" + article.getId() + ".html"); |
| | | columnData.setUrl(baseUrl + article.getPath() + "/" + article.getId() + ".html"); |
| | | } else if (column.getTargetType() == 2) { |
| | | ColumnEntity columnEntity = this.columnMapper.selectByCodeAndCompanyId(column.getTargetUrl(), column.getCompanyId()); |
| | | columnData.setUrl(cmsProperties.getBaseUrl() + columnEntity.getPath()); |
| | | columnData.setUrl(baseUrl + columnEntity.getPath()); |
| | | } else { |
| | | columnData.setUrl(column.getTargetUrl()); |
| | | } |
| | |
| | | |
| | | private ColumnMapper columnMapper = SpringContextHolder.getBean(ColumnMapper.class); |
| | | private ArticleMapper articleMapper = SpringContextHolder.getBean(ArticleMapper.class); |
| | | private CmsProperties cmsProperties = SpringContextHolder.getBean(CmsProperties.class); |
| | | |
| | | private String baseUrl = ""; |
| | | @Override |
| | | public void dataParser(AttrNode node) { |
| | | log.info("导航栏解析"); |
| | | Long companyId = (Long) node.getSystemDataValue("companyId"); |
| | | baseUrl = (String) node.getSystemDataValue("baseUrl"); |
| | | |
| | | List<ColumnEntity> columns = columnMapper.selectColumnByParentId(0L, companyId, 1); |
| | | |
| | |
| | | |
| | | NavData index = new NavData(); |
| | | index.setTitle("首页"); |
| | | index.setUrl(cmsProperties.getBaseUrl()); |
| | | index.setUrl(baseUrl); |
| | | index.setCode("index"); |
| | | list.add(index); |
| | | |
| | |
| | | public NavData columnToNav(ColumnEntity column) { |
| | | NavData navData = ColumnConversion.INSTANCE.columnToNav(column); |
| | | |
| | | navData.setUrl(cmsProperties.getBaseUrl() + column.getPath()); |
| | | navData.setUrl(baseUrl + column.getPath()); |
| | | if (column.getType() == 2) { |
| | | if (column.getTargetType() == 1) { |
| | | ArticleEntity article = this.articleMapper.selectArticleById(Long.parseLong(column.getTargetUrl())); |
| | | navData.setUrl(cmsProperties.getBaseUrl() + article.getPath() + "/" + article.getId() + ".html"); |
| | | navData.setUrl(baseUrl + article.getPath() + "/" + article.getId() + ".html"); |
| | | } else if (column.getTargetType() == 2) { |
| | | ColumnEntity columnEntity = this.columnMapper.selectByCodeAndCompanyId(column.getTargetUrl(), column.getCompanyId()); |
| | | navData.setUrl(cmsProperties.getBaseUrl() + columnEntity.getPath()); |
| | | navData.setUrl(baseUrl + columnEntity.getPath()); |
| | | } else { |
| | | navData.setUrl(column.getTargetUrl()); |
| | | } |
| | |
| | | public class PageDataParserHandler implements DataParserHandler { |
| | | |
| | | private ArticleMapper articleMapper = SpringContextHolder.getBean(ArticleMapper.class); |
| | | private CmsProperties cmsProperties = SpringContextHolder.getBean(CmsProperties.class); |
| | | @Override |
| | | public void dataParser(AttrNode attrNode) { |
| | | log.info("分页解析"); |
| | | synchronized (this) { |
| | | Template.HAS_PAGING = true; |
| | | String baseUrl = (String) attrNode.getSystemDataValue("baseUrl"); |
| | | |
| | | Long companyId = (Long) attrNode.getSystemDataValue("companyId"); |
| | | Pagination param = (Pagination) attrNode.getParam(); |
| | |
| | | pageData.setTotalCnt((int) pageList.getSize()); |
| | | |
| | | if (CollUtil.isNotEmpty(pageList.getRecords())) { |
| | | String path = cmsProperties.getBaseUrl() + "/" + param.getCode(); |
| | | String path = baseUrl + "/" + param.getCode(); |
| | | String filename = "index_{}.html"; |
| | | |
| | | List<PageChildData> list = new ArrayList<>(); |
| | |
| | | sb.append(partNode.getHtml()); |
| | | } |
| | | document = Jsoup.parse(sb.toString()); |
| | | String outPath = path(outputPath); |
| | | String outPath = path(outputPath) + system.get("companyCode"); |
| | | |
| | | String html = document.html(); |
| | | try { |
| | |
| | | |
| | | public abstract class Configuration { |
| | | |
| | | protected static String BASE_URL; |
| | | protected static String API_URL; |
| | | protected static String STATIC_URL; |
| | | protected static String staticPath; |
| | | protected static String templatePath; |
| | |
| | | public Configuration() { |
| | | } |
| | | |
| | | public Configuration(String templatePath, String staticPath, String outputPath, String baseUrl, String staticUrl) { |
| | | public Configuration(String templatePath, String staticPath, String outputPath, String apiUrl, String staticUrl) { |
| | | Configuration.staticPath = staticPath; |
| | | Configuration.templatePath = templatePath; |
| | | Configuration.outputPath = outputPath; |
| | | Configuration.BASE_URL = baseUrl; |
| | | Configuration.API_URL = apiUrl; |
| | | Configuration.STATIC_URL = staticUrl; |
| | | } |
| | | |
| | |
| | | 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; |
| | |
| | | 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 template = template(FileUtils.path(templatePath, companyCode), templateName); |
| | | template.output(outputPath); |
| | | |
| | | // 判断是否有分页,有则执行。从第二页开始 |
| | |
| | | while(Template.HAS_PAGING) { |
| | | map.put("page", i); |
| | | this.templateLoader.data(map); |
| | | Template pageTemplate = template(templateName); |
| | | Template pageTemplate = template(FileUtils.path(templatePath, companyCode), templateName); |
| | | pageTemplate.output(outputPath); |
| | | i++; |
| | | } |
| | | } |
| | | |
| | | public Template template(String templateName) { |
| | | public Template template(String templatePath, String templateName) { |
| | | return template(new File(path(templatePath) + templateName)); |
| | | } |
| | | |
| | |
| | | |
| | | void indexProcess(Map<String, Object> map, String templateName); |
| | | |
| | | void process(Map<String, Object> map, String templateType, String templateName); |
| | | |
| | | } |
| | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.xcong.farmer.cms.core.template.TemplateConfiguration; |
| | | import com.xcong.farmer.cms.modules.core.service.ICmsCoreService; |
| | | import com.xcong.farmer.cms.modules.system.mapper.WebSetMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Autowired |
| | | private TemplateConfiguration cfg; |
| | | |
| | | @Autowired |
| | | private WebSetMapper webSetMapper; |
| | | |
| | | |
| | | @Override |
| | | public void articleProcess(Map<String, Object> data, String templateName, String templatePath) { |
| | | data.put("templateType", "article"); |
| | | data.put("templatePath", templatePath); |
| | | data.put("templateName", data.get("id")); |
| | | globalData(data); |
| | | if (StrUtil.isEmpty(templateName)) { |
| | | templateName = "defualt.article.html"; |
| | | } |
| | |
| | | public void columnProcess(Map<String, Object> data, String templateName) { |
| | | data.put("templateType", "column"); |
| | | data.put("page", 1); |
| | | globalData(data); |
| | | if (StrUtil.isEmpty(templateName)) { |
| | | templateName = "defualt.list.html"; |
| | | } |
| | |
| | | @Override |
| | | public void indexProcess(@NotNull Map<String, Object> data, String templateName) { |
| | | data.put("templateType", "index"); |
| | | globalData(data); |
| | | if (StrUtil.isEmpty(templateName)) { |
| | | templateName = "index.html"; |
| | | } |
| | |
| | | log.error("发布首页错误", e); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void process(Map<String, Object> data, String templateType, String templateName) { |
| | | data.put("templateType", templateType); |
| | | globalData(data); |
| | | try { |
| | | cfg.process(data, templateName); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("发布错误", e); |
| | | } |
| | | } |
| | | |
| | | private void globalData(Map<String, Object> data) { |
| | | Long companyId = (Long) data.get("companyId"); |
| | | Map<String, String> globalSetting = webSetMapper.selectSiteGlobalSetting(companyId); |
| | | |
| | | data.putAll(globalSetting); |
| | | } |
| | | } |
| | |
| | | import com.xcong.farmer.cms.modules.system.entity.WebSettingEntity; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Map; |
| | | |
| | | public interface WebSetMapper extends BaseMapper<WebSettingEntity> { |
| | | |
| | | WebSettingEntity selectByCompanyId(@Param("companyId") Long companyId); |
| | | |
| | | Map<String, String> selectSiteGlobalSetting(@Param("companyId") Long companyId); |
| | | } |
| | |
| | | import com.xcong.farmer.cms.modules.system.dto.AdminSaveTemplateInfoDto; |
| | | import com.xcong.farmer.cms.modules.system.dto.TemplateListDto; |
| | | import com.xcong.farmer.cms.modules.system.entity.CmsTemplateEntity; |
| | | import com.xcong.farmer.cms.modules.system.entity.CompanyEntity; |
| | | import com.xcong.farmer.cms.modules.system.mapper.CmsTemplateMapper; |
| | | import com.xcong.farmer.cms.modules.system.mapper.CompanyMapper; |
| | | import com.xcong.farmer.cms.modules.system.service.ICmsTemplateService; |
| | | import com.xcong.farmer.cms.modules.system.util.LoginUserUtil; |
| | | import org.jsoup.Jsoup; |
| | |
| | | @Autowired |
| | | private CmsProperties properties; |
| | | |
| | | @Autowired |
| | | private CompanyMapper companyMapper; |
| | | |
| | | |
| | | private List<String> fileSuffix = Arrays.asList(".zip", ".html"); |
| | | |
| | | @Override |
| | |
| | | String templatePath = properties.getTemplatePath(); |
| | | String staticPath = properties.getStaticPath(); |
| | | Long companyId = LoginUserUtil.getCompanyId(); |
| | | CompanyEntity company = companyMapper.selectById(companyId); |
| | | |
| | | String companyCode = company.getCode(); |
| | | templatePath = FileUtils.path(templatePath, companyCode); |
| | | staticPath = FileUtils.path(staticPath, companyCode); |
| | | |
| | | String filename = upload.getOriginalFilename(); |
| | | String suffix = filename.substring(filename.lastIndexOf(".")); |
| | |
| | | continue; |
| | | } |
| | | |
| | | insertTemplate(templateFile, companyId); |
| | | insertTemplate(templateFile, companyId, companyCode); |
| | | } |
| | | } |
| | | |
| | | if (".html".equals(suffix)) { |
| | | FileUtil.touch(file); |
| | | |
| | | insertTemplate(file, companyId); |
| | | insertTemplate(file, companyId, companyCode); |
| | | } |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | |
| | | } |
| | | } |
| | | |
| | | private void insertTemplate(File file, Long companyId) throws IOException { |
| | | private void insertTemplate(File file, Long companyId, String companyCode) throws IOException { |
| | | Document parse = Jsoup.parse(file, null); |
| | | String attr = parse.head().attr("name"); |
| | | |
| | | staticPathParser(parse, "img", "src"); |
| | | staticPathParser(parse, "link", "href"); |
| | | staticPathParser(parse, "script", "src"); |
| | | staticPathParser(parse, "img", "src", companyCode); |
| | | staticPathParser(parse, "link", "href", companyCode); |
| | | staticPathParser(parse, "script", "src", companyCode); |
| | | |
| | | FileOutputStream outputStream = new FileOutputStream(file); |
| | | outputStream.write(parse.html().getBytes()); |
| | |
| | | this.baseMapper.insert(cmsTemplate); |
| | | } |
| | | |
| | | private void staticPathParser(Document document, String tagName, String attrKey) { |
| | | private void staticPathParser(Document document, String tagName, String attrKey, String companyCode) { |
| | | Elements elements = document.getElementsByTag(tagName); |
| | | if (elements.isEmpty()) { |
| | | return; |
| | |
| | | for (Element element : elements) { |
| | | String attr = element.attr(attrKey); |
| | | if (StrUtil.isNotBlank(attr) && !attr.contains("http://") && !attr.contains("https://")) { |
| | | element.attr(attrKey, cmsProperties.getStaticUrl() + attr); |
| | | element.attr(attrKey, cmsProperties.getStaticUrl() + companyCode + "/" + attr); |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xcong.farmer.cms.common.contants.AppContants; |
| | | import com.xcong.farmer.cms.common.response.Result; |
| | | import com.xcong.farmer.cms.configurations.properties.CmsProperties; |
| | | import com.xcong.farmer.cms.modules.system.dto.AdminAddColumnDto; |
| | | import com.xcong.farmer.cms.modules.system.dto.AdminColumnDto; |
| | | import com.xcong.farmer.cms.modules.system.dto.AdminDeleteDto; |
| | |
| | | private ArticleMapper articleMapper; |
| | | @Autowired |
| | | private CompanyMapper companyMapper; |
| | | @Autowired |
| | | private CmsProperties cmsProperties; |
| | | |
| | | @Override |
| | | public Result getColumnInPage(AdminColumnDto adminColumnDto) { |
| | |
| | | adminSeeColumnInfoVo.setType(columnEntity.getType()); |
| | | adminSeeColumnInfoVo.setTargetType(columnEntity.getTargetType()); |
| | | adminSeeColumnInfoVo.setContentType(columnEntity.getContentType()); |
| | | |
| | | CompanyEntity companyEntity = companyMapper.selectById(LoginUserUtil.getCompanyId()); |
| | | |
| | | if (columnEntity.getType() == 2) { |
| | | if (columnEntity.getTargetType() == 1) { |
| | | ArticleEntity articleEntity = articleMapper.selectById(Long.parseLong(columnEntity.getTargetUrl())); |
| | | adminSeeColumnInfoVo.setTargetName(articleEntity.getTitle()); |
| | | adminSeeColumnInfoVo.setUrl(cmsProperties.getBaseUrl() + columnEntity.getPath() + "/" + columnEntity.getTargetUrl() + ".html"); |
| | | adminSeeColumnInfoVo.setUrl(companyEntity.getWebAddress() + columnEntity.getPath() + "/" + columnEntity.getTargetUrl() + ".html"); |
| | | } else if (columnEntity.getTargetType() == 2) { |
| | | ColumnEntity column = this.baseMapper.selectByCodeAndCompanyId(columnEntity.getTargetUrl(), LoginUserUtil.getCompanyId()); |
| | | adminSeeColumnInfoVo.setTargetName(column.getColumnName()); |
| | | adminSeeColumnInfoVo.setUrl(cmsProperties.getBaseUrl() + column.getPath()); |
| | | adminSeeColumnInfoVo.setUrl(companyEntity.getWebAddress() + column.getPath()); |
| | | } |
| | | } else { |
| | | adminSeeColumnInfoVo.setUrl(cmsProperties.getBaseUrl() + columnEntity.getPath()); |
| | | adminSeeColumnInfoVo.setUrl(companyEntity.getWebAddress() + columnEntity.getPath()); |
| | | } |
| | | adminSeeColumnInfoVo.setTargetUrl(columnEntity.getTargetUrl()); |
| | | return Result.ok(adminSeeColumnInfoVo); |
| | |
| | | path: /image/ |
| | | |
| | | cms: |
| | | base-url: http://localhost |
| | | api-url: http://120.27.238.55:8878 |
| | | static-url: http://120.27.238.55:8000/cms/static/ |
| | | template-path: /Users/helius/Desktop/template |
| | | static-path: /Users/helius/Desktop/static |
| | | template-path: /Users/helius/Desktop/template-online/template |
| | | static-path: /Users/helius/Desktop/template-online/static |
| | | output-path: /Users/helius/Desktop/template-online/output |
| | | |
| | |
| | | where a.company_id=#{companyId} and a.company_id=b.id |
| | | </select> |
| | | |
| | | <select id="selectSiteGlobalSetting" resultType="java.util.Map"> |
| | | select |
| | | a.title title, |
| | | a.seo_title seoTitle, |
| | | a.seo_keyword seoKeyword, |
| | | a.seo_description seoDescription, |
| | | a.logo_url logo, |
| | | b.web_address baseUrl, |
| | | b.code companyCode |
| | | from t_web_setting a, t_company b |
| | | where a.company_id=#{companyId} and a.company_id=b.id |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | public void viewTemplateInfo() { |
| | | Long id = 4L; |
| | | CmsTemplateEntity cmsTemplateEntity = cmsTemplateMapper.selectById(id); |
| | | String htmlUrl = cmsProperties.getBaseUrl() + cmsProperties.getTemplatePath(); |
| | | String htmlUrl = "" + cmsProperties.getTemplatePath(); |
| | | File uploadDir = new File(htmlUrl); |
| | | if (!uploadDir.isDirectory()) { |
| | | uploadDir.mkdir(); |