From eca1c2ce8506dfd5ad8f94235382b666ea831dfd Mon Sep 17 00:00:00 2001
From: zhaowenxuan <chacca165@163.com>
Date: 星期六, 08 二月 2025 17:58:19 +0800
Subject: [PATCH] 动态切换数据库实现

---
 ltkj-framework/src/main/java/com/ltkj/framework/aspectj/DataSourceAspect.java |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/ltkj-framework/src/main/java/com/ltkj/framework/aspectj/DataSourceAspect.java b/ltkj-framework/src/main/java/com/ltkj/framework/aspectj/DataSourceAspect.java
index 1dccc09..e0014fd 100644
--- a/ltkj-framework/src/main/java/com/ltkj/framework/aspectj/DataSourceAspect.java
+++ b/ltkj-framework/src/main/java/com/ltkj/framework/aspectj/DataSourceAspect.java
@@ -2,6 +2,7 @@
 
 import java.util.Objects;
 
+import com.ltkj.db.DataSourceContextHolder;
 import com.ltkj.framework.datasource.DynamicDataSourceContextHolder;
 import org.aspectj.lang.ProceedingJoinPoint;
 import org.aspectj.lang.annotation.Around;
@@ -38,14 +39,14 @@
         DataSource dataSource = getDataSource(point);
 
         if (StringUtils.isNotNull(dataSource)) {
-            DynamicDataSourceContextHolder.setDataSourceType(dataSource.value().name());
+            DataSourceContextHolder.setDataSourceKey(dataSource.value().name());
         }
 
         try {
             return point.proceed();
         } finally {
             // 閿�姣佹暟鎹簮 鍦ㄦ墽琛屾柟娉曚箣鍚�
-            DynamicDataSourceContextHolder.clearDataSourceType();
+            DataSourceContextHolder.clear();
         }
     }
 

--
Gitblit v1.8.0