Skip to content

Commit

Permalink
Merge branch 'master' into 'hotfix-2.1.1'
Browse files Browse the repository at this point in the history
# Conflicts:
#   choerodon-gitlab4j-api/pom.xml
#   choerodon-starter-asgard/pom.xml
#   choerodon-starter-core/pom.xml
#   choerodon-starter-fragment/pom.xml
#   choerodon-starter-limit/pom.xml
#   choerodon-starter-nacos-client/pom.xml
#   choerodon-starter-only-office/pom.xml
#   choerodon-tool-liquibase/pom.xml
#   pom.xml
  • Loading branch information
王灏 committed Jul 29, 2022
2 parents d022856 + b54e41d commit ab3f718
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 11 deletions.
4 changes: 2 additions & 2 deletions choerodon-gitlab4j-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<modelVersion>4.0.0</modelVersion>
<artifactId>choerodon-gitlab4j-api</artifactId>
<version>2.1.1.RELEASE</version>
<version>2.2.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>choerodon-gitlab4j-api</name>
<description>GitLab API Java Client</description>
Expand All @@ -21,7 +21,7 @@
<parent>
<groupId>io.choerodon</groupId>
<artifactId>choerodon-starter-parent</artifactId>
<version>2.1.1.RELEASE</version>
<version>2.2.0-SNAPSHOT</version>
</parent>
<build>
<defaultGoal>package</defaultGoal>
Expand Down
2 changes: 1 addition & 1 deletion choerodon-starter-asgard/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>choerodon-starter-parent</artifactId>
<groupId>io.choerodon</groupId>
<version>2.1.1.RELEASE</version>
<version>2.2.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion choerodon-starter-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>choerodon-starter-parent</artifactId>
<groupId>io.choerodon</groupId>
<version>2.1.1.RELEASE</version>
<version>2.2.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package io.choerodon.core.utils;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;
import java.util.Arrays;

import com.alibaba.fastjson.JSON;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.util.Assert;

/**
* Copyright (c) 2022. Hand Enterprise Solution Company. All right reserved.
*
* @author [email protected]
* @since 2022/7/13
*/
public class FeignFallbackUtil {

private FeignFallbackUtil() {
}

public static <T> T get(Throwable cause, Class<T> targetClass) {
Assert.notNull(targetClass, "feign target class could not be null!");
Logger logger = LoggerFactory.getLogger(targetClass);
InvocationHandler invocationHandler = (proxy, method, args) -> {
logger.error("error when call {}.{} by params{}", method.getDeclaringClass().getSimpleName(),
method.getName(), JSON.toJSONString(args));
if (cause != null) {
logger.error(cause.getMessage(), cause);
}
return ResponseEntity.badRequest().contentType(MediaType.APPLICATION_JSON).body("请联系运维人员");
};
return (T) Proxy.newProxyInstance(targetClass.getClassLoader(), new Class[]{targetClass}, invocationHandler);
}

}
2 changes: 1 addition & 1 deletion choerodon-starter-fragment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>choerodon-starter-parent</artifactId>
<groupId>io.choerodon</groupId>
<version>2.1.1.RELEASE</version>
<version>2.2.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion choerodon-starter-limit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>choerodon-starter-parent</artifactId>
<groupId>io.choerodon</groupId>
<version>2.1.1.RELEASE</version>
<version>2.2.0-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion choerodon-starter-nacos-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<parent>
<artifactId>choerodon-starter-parent</artifactId>
<groupId>io.choerodon</groupId>
<version>2.1.1.RELEASE</version>
<version>2.2.0-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
4 changes: 2 additions & 2 deletions choerodon-starter-only-office/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<parent>
<artifactId>choerodon-starter-parent</artifactId>
<groupId>io.choerodon</groupId>
<version>2.1.1.RELEASE</version>
<version>2.2.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>choerodon-starter-only-office</artifactId>
<version>2.1.1.RELEASE</version>
<version>2.2.0-SNAPSHOT</version>

<dependencies>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion choerodon-tool-liquibase/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.choerodon</groupId>
<artifactId>choerodon-starter-parent</artifactId>
<version>2.1.1.RELEASE</version>
<version>2.2.0-SNAPSHOT</version>
</parent>

<artifactId>choerodon-tool-liquibase</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.choerodon</groupId>
<artifactId>choerodon-starter-parent</artifactId>
<version>2.1.1.RELEASE</version>
<version>2.2.0-SNAPSHOT</version>
<packaging>pom</packaging>

<parent>
Expand Down

0 comments on commit ab3f718

Please sign in to comment.