org.zodiac.autoconfigure.template.TemplateAutoConfiguration Maven / Gradle / Ivy
package org.zodiac.autoconfigure.template;
import java.util.Arrays;
import java.util.Map;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.zodiac.autoconfigure.application.ApplicationInfoProperties;
import org.zodiac.commons.util.ArrayUtil;
import org.zodiac.commons.util.Colls;
@SpringBootConfiguration
@ConditionalOnClass(value = {org.zodiac.template.base.TemplateService.class})
public class TemplateAutoConfiguration {
public TemplateAutoConfiguration() {
}
@Bean
@ConditionalOnMissingBean
@ConfigurationProperties(prefix = org.zodiac.template.base.constants.TemplateSystemPropertiesConstants.SPRING_TEMPLATE_PREFIX, ignoreInvalidFields = true)
protected TemplateProperties templateProperties(ApplicationInfoProperties applicationInfoProperties) {
return new TemplateProperties().setAppEnvType(applicationInfoProperties.envType());
}
@Bean
@ConditionalOnMissingBean
protected org.zodiac.template.base.TemplateService templateService(ObjectProvider