Commit aebe0d96 by qiuweili123

修复兼容性问题

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