Commit aebe0d96 by qiuweili123

修复兼容性问题

parent 0a5863cb
......@@ -50,18 +50,15 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
......
......@@ -17,10 +17,10 @@ package com.secoo.mall.mybatis.interceptor;
import com.baomidou.mybatisplus.core.toolkit.*;
import com.baomidou.mybatisplus.core.toolkit.sql.SqlUtils;
import com.mysql.cj.jdbc.ClientPreparedStatement;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.reflect.MethodUtils;
import org.apache.ibatis.executor.statement.StatementHandler;
import org.apache.ibatis.logging.Log;
import org.apache.ibatis.logging.LogFactory;
......@@ -101,14 +101,9 @@ public class MatrixPerformanceInterceptor implements Interceptor {
String originalSql = null;
String stmtClassName = statement.getClass().getName();
if (DruidPooledPreparedStatement.equals(stmtClassName)) {
try {
if (statement instanceof ClientPreparedStatement) {
originalSql = ClientPreparedStatement.class.cast(Statement.class).asSql();
}
Object rawPreparedStatement = MethodUtils.invokeExactMethod(statement, "getRawPreparedStatement");
originalSql = MethodUtils.invokeExactMethod(rawPreparedStatement, "asSql").toString();
} catch (Exception e) {
e.printStackTrace();
}
} else if (T4CPreparedStatement.equals(stmtClassName)
|| OraclePreparedStatementWrapper.equals(stmtClassName)) {
try {
......
......@@ -28,7 +28,6 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
......
......@@ -6,6 +6,7 @@ import com.secoo.mall.common.util.sys.SystemUtil;
import com.secoo.mall.web.annotation.ApiController;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
......@@ -29,6 +30,7 @@ public class MatrixWebAutoConfiguration {
private String appVersion;
@Bean
@ConditionalOnMissingBean(Docket.class)
public Docket createWebApi() {
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo()).enable(SystemUtil.isBetaEnv())
......
......@@ -66,11 +66,7 @@
</exclusion>
</exclusions>
</dependency>-->
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
<version>${dubbo-starter.version}</version>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
......@@ -90,6 +86,17 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
<version>${dubbo-starter.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--zookeeper-->
<dependency>
<groupId>org.apache.dubbo</groupId>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment