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;
|
}
|
}
|