From 2c2dad24d59b37df254d1c003d6c3e1119b51d6c Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期三, 11 八月 2021 14:28:05 +0800
Subject: [PATCH] update 更新 阿里云 maven源 新地址

---
 ruoyi-framework/src/main/java/com/ruoyi/framework/config/FeignConfig.java |   51 +++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 43 insertions(+), 8 deletions(-)

diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/FeignConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/FeignConfig.java
index 426b084..14db1c9 100644
--- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/FeignConfig.java
+++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/FeignConfig.java
@@ -1,7 +1,6 @@
 package com.ruoyi.framework.config;
 
 import feign.*;
-import feign.hystrix.HystrixFeign;
 import okhttp3.ConnectionPool;
 import okhttp3.OkHttpClient;
 import org.springframework.boot.autoconfigure.AutoConfigureBefore;
@@ -14,7 +13,12 @@
 
 import java.util.concurrent.TimeUnit;
 
-@EnableFeignClients("com.ruoyi.**.feign")
+/**
+ * openfeign閰嶇疆绫�
+ *
+ * @author Lion Li
+ */
+@EnableFeignClients("${feign.package}")
 @Configuration
 @ConditionalOnClass(Feign.class)
 @AutoConfigureBefore(FeignAutoConfiguration.class)
@@ -28,11 +32,6 @@
                 .writeTimeout(120, TimeUnit.SECONDS)
                 .connectionPool(new ConnectionPool())
                 .build();
-    }
-
-    @Bean
-    public Feign.Builder feignBuilder() {
-        return HystrixFeign.builder();
     }
 
     @Bean
@@ -55,4 +54,40 @@
         return new Retryer.Default();
     }
 
-}
\ No newline at end of file
+//	/**
+//	 * 鑷畾涔夊紓甯歌В鐮佸櫒
+//	 * 鐢ㄤ簬鑷畾涔夎繑鍥炰綋寮傚父鐔旀柇
+//	 */
+//	@Bean
+//	public ErrorDecoder errorDecoder() {
+//		return new CustomErrorDecoder();
+//	}
+//
+//
+//	/**
+//	 * 鑷畾涔夎繑鍥炰綋瑙g爜鍣�
+//	 */
+//	@Slf4j
+//	public static class CustomErrorDecoder implements ErrorDecoder {
+//
+//		@Override
+//		public Exception decode(String methodKey, Response response) {
+//			Exception exception = null;
+//			try {
+//				// 鑾峰彇鍘熷鐨勮繑鍥炲唴瀹�
+//				String json = JsonUtils.toJsonString(response.body().asReader(StandardCharsets.UTF_8));
+//				exception = new RuntimeException(json);
+//				// 灏嗚繑鍥炲唴瀹瑰弽搴忓垪鍖栦负Result锛岃繖閲屽簲鏍规嵁鑷韩椤圭洰浣滀慨鏀�
+//				AjaxResult result = JsonUtils.parseObject(json, AjaxResult.class);
+//				// 涓氬姟寮傚父鎶涘嚭绠�鍗曠殑 RuntimeException锛屼繚鐣欏師鏉ラ敊璇俊鎭�
+//				if (result.getCode() != 200) {
+//					exception = new RuntimeException(result.getMsg());
+//				}
+//			} catch (IOException e) {
+//				log.error(e.getMessage(), e);
+//			}
+//			return exception;
+//		}
+//	}
+
+}

--
Gitblit v1.9.3