浏览代码

update:服务降级配置

yonge 5 年之前
父节点
当前提交
3a4d8d3a1b

+ 1 - 0
mec-auth/mec-auth-api/src/main/java/com/ym/mec/auth/api/client/fallback/SysUserFeignServiceFallback.java

@@ -16,6 +16,7 @@ public class SysUserFeignServiceFallback implements SysUserFeignService {
 
 	@Override
 	public Object test() {
+		System.out.println("******进入服务降级方法******");
 		return "服务正在拍";
 	}
 

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/School.java

@@ -52,8 +52,10 @@ public class School {
 	@ApiModelProperty(value = "补贴", required = false)
 	private BigDecimal subsidy;
 	
+	@ApiModelProperty(value = "合作单位编号", required = false)
 	private Integer cooperationOrganId;
 	
+	@ApiModelProperty(value = "备注", required = false)
 	private String remark;
 
 	public void setId(Integer id) {

+ 3 - 0
mec-common/common-core/src/main/java/com/ym/mec/common/config/FeignConfiguration.java

@@ -17,6 +17,9 @@ public class FeignConfiguration implements RequestInterceptor {
 	@Override
 	public void apply(RequestTemplate template) {
 		ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
+		if (attributes == null) {
+			return;
+		}
 		HttpServletRequest request = attributes.getRequest();
 		Enumeration<String> headerNames = request.getHeaderNames();
 		if (headerNames != null) {

+ 5 - 1
mec-education/src/main/resources/application.yml

@@ -72,4 +72,8 @@ management:
         include: "*"
   endpoint:
     health:
-      show-details: ALWAYS
+      show-details: ALWAYS
+  
+feign:
+  hystrix:
+    enabled: true

+ 5 - 1
mec-student/src/main/resources/application.yml

@@ -72,4 +72,8 @@ management:
         include: "*"
   endpoint:
     health:
-      show-details: ALWAYS
+      show-details: ALWAYS
+  
+feign:
+  hystrix:
+    enabled: true

+ 5 - 1
mec-task/src/main/resources/application.yml

@@ -50,4 +50,8 @@ security:
       token-info-uri: http://localhost:8001/oauth/check_token
       
 swagger:
-  base-package: com.ym.mec.task.controller
+  base-package: com.ym.mec.task.controller
+  
+feign:
+  hystrix:
+    enabled: true

+ 5 - 1
mec-teacher/src/main/resources/application.yml

@@ -72,4 +72,8 @@ management:
         include: "*"
   endpoint:
     health:
-      show-details: ALWAYS
+      show-details: ALWAYS
+  
+feign:
+  hystrix:
+    enabled: true

+ 5 - 1
mec-web/src/main/resources/application.yml

@@ -72,4 +72,8 @@ management:
         include: "*"
   endpoint:
     health:
-      show-details: ALWAYS
+      show-details: ALWAYS
+  
+feign:
+  hystrix:
+    enabled: true