fix
Helius
2022-07-07 08e5cfa5651c15a79bcbcff2b04a1dda6c5c961b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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;
 
/**
 * @author wzy
 * @date 2022-07-03
 **/
@Slf4j
@Configuration
public class CmsConfig {
 
    @Autowired
    private CmsProperties cmsProperties;
 
    @Bean
    public TemplateConfiguration templateConfiguration() {
        log.info("CMS管理系统");
        TemplateConfiguration cfg = new TemplateConfiguration(cmsProperties.getTemplatePath(), cmsProperties.getStaticPath(), cmsProperties.getOutputPath(), cmsProperties.getBaseUrl(), cmsProperties.getStaticUrl());
        TemplateLoader loader = new TemplateLoader(cfg);
        cfg.templateLoader(loader);
        return cfg;
    }
}