diff --git a/mybatis-flex-spring-boot-starter/src/main/java/com/mybatisflex/spring/boot/MultiDataSourceAutoConfiguration.java b/mybatis-flex-spring-boot-starter/src/main/java/com/mybatisflex/spring/boot/MultiDataSourceAutoConfiguration.java index 8576ddd3..315a0e95 100644 --- a/mybatis-flex-spring-boot-starter/src/main/java/com/mybatisflex/spring/boot/MultiDataSourceAutoConfiguration.java +++ b/mybatis-flex-spring-boot-starter/src/main/java/com/mybatisflex/spring/boot/MultiDataSourceAutoConfiguration.java @@ -19,7 +19,6 @@ import com.mybatisflex.core.datasource.DataSourceBuilder; import com.mybatisflex.core.datasource.DataSourceDecipher; import com.mybatisflex.core.datasource.DataSourceManager; import com.mybatisflex.core.datasource.FlexDataSource; -import com.mybatisflex.spring.SeataMode; import com.mybatisflex.spring.boot.MybatisFlexProperties.SeataConfig; import com.mybatisflex.spring.datasource.DataSourceAdvice; import io.seata.rm.datasource.DataSourceProxy; @@ -87,7 +86,7 @@ public class MultiDataSourceAutoConfiguration { DataSourceManager.decryptDataSource(dataSource); if (seataConfig != null && seataConfig.isEnable()) { - if (seataConfig.getSeataMode() == SeataMode.XA) { + if (seataConfig.getSeataMode() == MybatisFlexProperties.SeataMode.XA) { dataSource = new DataSourceProxyXA(dataSource); } else { dataSource = new DataSourceProxy(dataSource); diff --git a/mybatis-flex-spring-boot-starter/src/main/java/com/mybatisflex/spring/boot/MybatisFlexProperties.java b/mybatis-flex-spring-boot-starter/src/main/java/com/mybatisflex/spring/boot/MybatisFlexProperties.java index b7cbd98c..50e60d91 100644 --- a/mybatis-flex-spring-boot-starter/src/main/java/com/mybatisflex/spring/boot/MybatisFlexProperties.java +++ b/mybatis-flex-spring-boot-starter/src/main/java/com/mybatisflex/spring/boot/MybatisFlexProperties.java @@ -17,7 +17,6 @@ package com.mybatisflex.spring.boot; import com.mybatisflex.core.FlexConsts; import com.mybatisflex.core.FlexGlobalConfig; -import com.mybatisflex.spring.SeataMode; import org.apache.ibatis.io.VFS; import org.apache.ibatis.logging.Log; import org.apache.ibatis.mapping.ResultSetType; @@ -42,6 +41,7 @@ import java.util.stream.Stream; /** * Mybatis-Flex 的配置属性。 * 参考:https://github.com/mybatis/spring-boot-starter/blob/master/mybatis-spring-boot-autoconfigure/src/main/java/org/mybatis/spring/boot/autoconfigure/MybatisProperties.java + * * @author Eddú Meléndez * @author Kazuki Shimizu * @author micahel @@ -909,7 +909,7 @@ public class MybatisFlexProperties { * * @author life */ - public static class SeataConfig{ + public static class SeataConfig { /** * 是否开启 @@ -936,6 +936,18 @@ public class MybatisFlexProperties { public void setSeataMode(SeataMode seataMode) { this.seataMode = seataMode; } + + } + + /** + * @author life + */ + public enum SeataMode { + + XA, + + AT + } } diff --git a/mybatis-flex-spring/src/main/java/com/mybatisflex/spring/SeataMode.java b/mybatis-flex-spring/src/main/java/com/mybatisflex/spring/SeataMode.java deleted file mode 100644 index cbabe97b..00000000 --- a/mybatis-flex-spring/src/main/java/com/mybatisflex/spring/SeataMode.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022-2023, Mybatis-Flex (fuhai999@gmail.com). - *

- * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - *

- * http://www.apache.org/licenses/LICENSE-2.0 - *

- * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.mybatisflex.spring; - -/** - * @author life - */ -public enum SeataMode { - - XA, - - AT -}