package cn.quantgroup.xyqb.config.http;

import cn.quantgroup.xyqb.service.http.IHttpService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;

/**
 * rest
 * <p>
 * Date: 2019/11/5
 * Time: 上午11:37
 *
 * @author: yangrui
 *
 * @deprecated Use
 * {@link IHttpService}}
 * instead. 统一.
 */
@Deprecated
@Configuration
public class RestTemplateConfig {

    @Bean
    public RestTemplate restTemplate() {
        SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory();
        requestFactory.setConnectTimeout(60 * 1000);
        requestFactory.setReadTimeout(60 * 1000);

        RestTemplate restTemplate = new RestTemplate(requestFactory);
        return restTemplate;
    }
}
