数据同步
parent
93241dd2b9
commit
3dad453694
|
|
@ -0,0 +1,31 @@
|
||||||
|
/**
|
||||||
|
* Copyright © 2021-2025 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
|
||||||
|
*/
|
||||||
|
package net.juntech.modules.ysdp.sync.config;
|
||||||
|
|
||||||
|
import org.springframework.boot.web.client.RestTemplateBuilder;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.http.client.SimpleClientHttpRequestFactory;
|
||||||
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
|
import java.time.Duration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RestTemplate 配置
|
||||||
|
* 用于调用数据中心 API
|
||||||
|
*
|
||||||
|
* @author Claude
|
||||||
|
* @version 2026-08-28
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class RestTemplateConfig {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public RestTemplate restTemplate(RestTemplateBuilder builder, DataCenterConfig config) {
|
||||||
|
return builder
|
||||||
|
.setConnectTimeout(Duration.ofMillis(config.getConnectTimeout()))
|
||||||
|
.setReadTimeout(Duration.ofMillis(config.getReadTimeout()))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue