xiaoyong931011
2022-07-07 1facfdc9361d888d72c959bac4d8fb05dcad02d7
src/main/java/com/xcong/farmer/cms/configurations/CmsConfig.java
@@ -1,8 +1,11 @@
package com.xcong.farmer.cms.configurations;
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 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;
@@ -14,10 +17,13 @@
@Configuration
public class CmsConfig {
    @Autowired
    private CmsProperties cmsProperties;
    @Bean
    public TemplateConfiguration templateConfiguration() {
        log.info("CMS管理系统");
        TemplateConfiguration cfg = new TemplateConfiguration("/Users/helius/Desktop/template", "", "/Users/helius/Desktop/web/output");
        TemplateConfiguration cfg = new TemplateConfiguration(cmsProperties.getTemplatePath(), cmsProperties.getStaticPath(), cmsProperties.getOutputPath(), cmsProperties.getBaseUrl(), cmsProperties.getStaticUrl());
        TemplateLoader loader = new TemplateLoader(cfg);
        cfg.templateLoader(loader);
        return cfg;