shikeying
2022-09-23 eb440e88db0f1a2c405a1e256d33df39f091404d
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
package com.iplatform.recvideo.config;
 
import com.iplatform.core.PlatformConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;
 
@Configuration
public class VideoSimilarConfig extends PlatformConfiguration {
 
    @Bean
    public VideoSimilarProperties videoSimilarProperties(){
        return new VideoSimilarProperties();
    }
 
    /**
     * 创建远程调用对象,临时使用内置Http配置,后续会单独发布模块支持 okHttp
     * @return
     * @date 2022-09-23
     */
    @Bean
    public RestTemplate restTemplate(){
        SimpleClientHttpRequestFactory clientHttpRequestFactory = new SimpleClientHttpRequestFactory();
        clientHttpRequestFactory.setConnectTimeout(10 * 1000);
        clientHttpRequestFactory.setReadTimeout(1200 * 1000);
        return new RestTemplate(clientHttpRequestFactory);
    }
}