update 多数据源切换标注过期 3.6.0 移除 推荐使用原生注解

feature/model
疯狂的狮子li 3 years ago
parent be13e3494a
commit a9488ba3c9

@ -95,6 +95,13 @@
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-extension</artifactId>
</dependency>
<!-- dynamic-datasource 多数据源-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>

@ -10,11 +10,13 @@ import java.lang.annotation.*;
*
*
* @author ruoyi
* @deprecated 3.6.0 使 {@link com.baomidou.dynamic.datasource.annotation.DS}
*/
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@Deprecated
public @interface DataSource {
/**
*

@ -7,8 +7,10 @@ import lombok.Getter;
*
*
* @author Lion Li
* @deprecated 3.6.0
*/
@AllArgsConstructor
@Deprecated
public enum DataSourceType {
/**
*

@ -23,7 +23,7 @@ import java.util.Map;
* @author Lion Li
* @date 2021-07-26
*/
//@DataSource(DataSourceType.SLAVE) // 切换从库查询
// @DS("slave") // 切换从库查询
@Service
public class TestTreeServiceImpl extends ServicePlusImpl<TestTreeMapper, TestTree, TestTreeVo> implements ITestTreeService {
@ -32,7 +32,7 @@ public class TestTreeServiceImpl extends ServicePlusImpl<TestTreeMapper, TestTre
return getVoById(id);
}
// @DataSource(DataSourceType.SLAVE) // 切换从库查询
// @DS("slave") // 切换从库查询
@DataScope(isUser = true)
@Override
public List<TestTreeVo> queryList(TestTreeBo bo) {

@ -46,11 +46,6 @@
<artifactId>druid-spring-boot-starter</artifactId>
</dependency>
<!-- dynamic-datasource 多数据源-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
</dependency>
<!-- sql性能分析插件 -->
<dependency>
<groupId>p6spy</groupId>

@ -18,10 +18,12 @@ import java.util.Objects;
*
*
* @author Lion Li
* @deprecated 3.6.0 使
*/
@Aspect
@Order(-500)
@Component
@Deprecated
public class DataSourceAspect {
@Pointcut("@annotation(com.ruoyi.common.annotation.DataSource)"

@ -53,7 +53,7 @@ public class SysConfigServiceImpl extends ServicePlusImpl<SysConfigMapper, SysCo
* @return
*/
@Override
@DataSource(DataSourceType.MASTER)
@DS("master")
public SysConfig selectConfigById(Long configId) {
return baseMapper.selectById(configId);
}

Loading…
Cancel
Save