feat(后端): 联调修改5

master
rdpnr_puzhi 2025-08-13 09:58:33 +08:00
parent 2e90f5684f
commit ff0a9e756f
2 changed files with 13 additions and 1 deletions

View File

@ -86,6 +86,13 @@
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<!-- Apache HttpClient 依赖 -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.14</version>
</dependency>
<dependency>

View File

@ -2,6 +2,7 @@ package com.unisinsight.project.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;
/**
@ -15,6 +16,10 @@ public class RestTemplateConfig {
@Bean
public RestTemplate restTemplate() {
return new RestTemplate();
HttpComponentsClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory();
factory.setConnectTimeout(600000);
factory.setReadTimeout(600000);
factory.setConnectionRequestTimeout(600000);
return new RestTemplate(factory);
}
}