All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openea.eap.framework.env.config.EapEnvWebAutoConfiguration Maven / Gradle / Ivy

Go to download

开发环境拓展,实现类似阿里的特性环境的能力 1. https://segmentfault.com/a/1190000018022987

The newest version!
package org.openea.eap.framework.env.config;

import org.openea.eap.framework.common.enums.WebFilterOrderEnum;
import org.openea.eap.framework.env.core.web.EnvWebFilter;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;

/**
 * 多环境的 Web 组件的自动配置
 *
 */
@AutoConfiguration
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
@EnableConfigurationProperties(EnvProperties.class)
public class EapEnvWebAutoConfiguration {

    /**
     * 创建 {@link EnvWebFilter} Bean
     */
    @Bean
    public FilterRegistrationBean envWebFilterFilter() {
        EnvWebFilter filter = new EnvWebFilter();
        FilterRegistrationBean bean = new FilterRegistrationBean<>(filter);
        bean.setOrder(WebFilterOrderEnum.ENV_TAG_FILTER);
        return bean;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy