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

top.jfunc.common.http.boot.SmartHttpAutoConfigure Maven / Gradle / Ivy

package top.jfunc.common.http.boot;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
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 top.jfunc.common.http.smart.NativeSmartHttpClient;
import top.jfunc.common.http.smart.SmartHttpClient;

/**
 * @author xiongshiyan at 2019/5/10 , contact me with email [email protected] or phone 15208384257
 */
@Configuration@ConditionalOnClass(NativeSmartHttpClient.class)
@EnableConfigurationProperties(SmartHttpProperties.class)
public class SmartHttpAutoConfigure {

    @Bean(name = "smartHttpClient")
    @ConditionalOnMissingBean
    public SmartHttpClient smartHttpClient(@Autowired SmartHttpProperties smartHttpProperties){
        SmartHttpClient smartHttpClient = new NativeSmartHttpClient();

        SmartHttpAutoConfigureUtil.configSmartHttpClient(smartHttpClient , smartHttpProperties);

        return smartHttpClient;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy