From d51a8cfa10c34d9c1e7d6b4726d31e75ecee5dc6 Mon Sep 17 00:00:00 2001 From: phpcjl <phpcjl@gmail.com> Date: 星期五, 20 十二月 2024 18:32:03 +0800 Subject: [PATCH] 1 --- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/config/HttpConfig.java | 25 +++++++++++++++++++++++++ 1 files changed, 25 insertions(+), 0 deletions(-) diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/config/HttpConfig.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/config/HttpConfig.java new file mode 100644 index 0000000..2509b1d --- /dev/null +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/config/HttpConfig.java @@ -0,0 +1,25 @@ +package com.ruoyi.other.config; + +import org.springframework.beans.factory.annotation.Autowired; +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; + +/** + * http请求工具配置 + * + * @author: KingKong + * @create: 2018-11-14 10:47 + **/ +@Configuration +public class HttpConfig { + + @Autowired + private RestTemplateBuilder builder; + + @Bean + public RestTemplate restTemplate() { + return builder.build(); + } +} -- Gitblit v1.7.1