package cn.qinys.platform.base.config;

import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

import java.time.Duration;

/**
 * Description:
 *
 * @author tanlie
 * Date: 2024/3/7 9:46
 */
@Configuration
public class BaseBeanConfig {

    @Bean
    RestTemplate restTemplate() {
        RestTemplateBuilder builder = new RestTemplateBuilder();
        builder.connectTimeout(Duration.ofSeconds(30));
        builder.readTimeout(Duration.ofSeconds(120));
        return builder.build();
    }

}
