yangys
2024-03-27 e48aa2ac8dea1be5db11c63edf0b912c4ad5ce65
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
package com.qianwen.core.context.config;
 
import com.qianwen.core.context.BladeContext;
import com.qianwen.core.context.BladeHttpHeadersGetter;
import com.qianwen.core.context.BladeServletContext;
import com.qianwen.core.context.ServletHttpHeadersGetter;
import com.qianwen.core.context.props.BladeContextProperties;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
 
@EnableConfigurationProperties({BladeContextProperties.class})
@Configuration(proxyBeanMethods = false)
@Order(Integer.MIN_VALUE)
/* loaded from: blade-core-context-9.3.0.0-SNAPSHOT.jar:org/springblade/core/context/config/BladeContextAutoConfiguration.class */
public class BladeContextAutoConfiguration {
    @ConditionalOnMissingBean
    @Bean
    public BladeHttpHeadersGetter bladeHttpHeadersGetter(BladeContextProperties contextProperties) {
        return new ServletHttpHeadersGetter(contextProperties);
    }
 
    @ConditionalOnMissingBean
    @Bean
    public BladeContext bladeContext(BladeContextProperties contextProperties, BladeHttpHeadersGetter httpHeadersGetter) {
        return new BladeServletContext(contextProperties, httpHeadersGetter);
    }
}