From f308c27c1f6f90fc1006fc37a1cbabcdda2a7cd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=8C=E8=90=8C=E5=93=92Sakura=E9=85=B1?= Date: Mon, 25 Feb 2019 14:36:59 +0800 Subject: [PATCH 1/2] :beers: Writing code drunkenly.rename variable --- .../springframework/cloud/openfeign/PigxFeignFallback.java | 2 +- .../openfeign/PigxHystrixFeignTargeterConfiguration.java | 2 +- .../springframework/cloud/openfeign/PigxHystrixTargeter.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pigx-common/pigx-common-security/src/main/java/org/springframework/cloud/openfeign/PigxFeignFallback.java b/pigx-common/pigx-common-security/src/main/java/org/springframework/cloud/openfeign/PigxFeignFallback.java index c5a5a9201..d5f7729ed 100644 --- a/pigx-common/pigx-common-security/src/main/java/org/springframework/cloud/openfeign/PigxFeignFallback.java +++ b/pigx-common/pigx-common-security/src/main/java/org/springframework/cloud/openfeign/PigxFeignFallback.java @@ -47,7 +47,7 @@ public class PigxFeignFallback implements MethodInterceptor { @Override public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable { String errorMessage = cause.getMessage(); - log.error("MicaFeignFallback:[{}.{}] serviceId:[{}] message:[{}]", targetType.getName(), method.getName(), targetName, errorMessage); + log.error("PigxFeignFallback:[{}.{}] serviceId:[{}] message:[{}]", targetType.getName(), method.getName(), targetName, errorMessage); Class returnType = method.getReturnType(); if (R.class != returnType) { return null; diff --git a/pigx-common/pigx-common-security/src/main/java/org/springframework/cloud/openfeign/PigxHystrixFeignTargeterConfiguration.java b/pigx-common/pigx-common-security/src/main/java/org/springframework/cloud/openfeign/PigxHystrixFeignTargeterConfiguration.java index 2a289d9ec..23430c455 100644 --- a/pigx-common/pigx-common-security/src/main/java/org/springframework/cloud/openfeign/PigxHystrixFeignTargeterConfiguration.java +++ b/pigx-common/pigx-common-security/src/main/java/org/springframework/cloud/openfeign/PigxHystrixFeignTargeterConfiguration.java @@ -36,7 +36,7 @@ public class PigxHystrixFeignTargeterConfiguration { @Bean @Primary - public Targeter micaFeignTargeter() { + public Targeter pigxFeignTargeter() { return new PigxHystrixTargeter(); } } diff --git a/pigx-common/pigx-common-security/src/main/java/org/springframework/cloud/openfeign/PigxHystrixTargeter.java b/pigx-common/pigx-common-security/src/main/java/org/springframework/cloud/openfeign/PigxHystrixTargeter.java index fa492f786..4246a9368 100644 --- a/pigx-common/pigx-common-security/src/main/java/org/springframework/cloud/openfeign/PigxHystrixTargeter.java +++ b/pigx-common/pigx-common-security/src/main/java/org/springframework/cloud/openfeign/PigxHystrixTargeter.java @@ -52,8 +52,8 @@ class PigxHystrixTargeter implements Targeter { return targetWithFallbackFactory(factory.getName(), context, target, builder, fallbackFactory); } - PigxFallbackFactory micaFallbackFactory = new PigxFallbackFactory(target); - return (T) builder.target(target, micaFallbackFactory); + PigxFallbackFactory pigxFallbackFactory = new PigxFallbackFactory(target); + return (T) builder.target(target, pigxFallbackFactory); } private T targetWithFallbackFactory(String feignClientName, FeignContext context, From 025bdffa8113a34bf73c9537131a5e8c7953bf77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=8C=E8=90=8C=E5=93=92Sakura=E9=85=B1?= Date: Mon, 25 Feb 2019 15:09:18 +0800 Subject: [PATCH 2/2] :card_file_box: Performing database related changes.reduce del_flag column length in `oa_leave_bill` --- db/3pigxx_ac.sql | 2 +- .../springframework/cloud/openfeign/PigxFeignFallback.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/db/3pigxx_ac.sql b/db/3pigxx_ac.sql index 31aa36dca..6a6222251 100644 --- a/db/3pigxx_ac.sql +++ b/db/3pigxx_ac.sql @@ -673,7 +673,7 @@ CREATE TABLE `oa_leave_bill` ( `leave_time` datetime DEFAULT NULL COMMENT '请假时间', `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', - `del_flag` char(50) DEFAULT '0' COMMENT '删除标识', + `del_flag` char(1) DEFAULT '0' COMMENT '删除标识', `tenant_id` int(11) NOT NULL COMMENT '所属租户', PRIMARY KEY (`leave_id`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4; diff --git a/pigx-common/pigx-common-security/src/main/java/org/springframework/cloud/openfeign/PigxFeignFallback.java b/pigx-common/pigx-common-security/src/main/java/org/springframework/cloud/openfeign/PigxFeignFallback.java index d5f7729ed..bddc2d235 100644 --- a/pigx-common/pigx-common-security/src/main/java/org/springframework/cloud/openfeign/PigxFeignFallback.java +++ b/pigx-common/pigx-common-security/src/main/java/org/springframework/cloud/openfeign/PigxFeignFallback.java @@ -17,7 +17,6 @@ package org.springframework.cloud.openfeign; -import cn.hutool.core.util.CharsetUtil; import cn.hutool.core.util.StrUtil; import com.pig4cloud.pigx.common.core.constant.CommonConstants; import com.pig4cloud.pigx.common.core.util.R; @@ -29,6 +28,7 @@ import org.springframework.cglib.proxy.MethodProxy; import org.springframework.lang.Nullable; import java.lang.reflect.Method; +import java.nio.charset.StandardCharsets; import java.util.Objects; /** @@ -56,7 +56,7 @@ public class PigxFeignFallback implements MethodInterceptor { byte[] content = exception.content(); - String str = StrUtil.str(content, CharsetUtil.UTF_8); + String str = StrUtil.str(content, StandardCharsets.UTF_8); return R.builder().code(CommonConstants.FAIL) .msg(str).build();