update 更新多数据源演示案例

feature/model
疯狂的狮子li 3 years ago
parent 40bba563d6
commit 81897d0b04

@ -1,9 +1,7 @@
package com.ruoyi.demo.mapper;
import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache;
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
import com.ruoyi.demo.domain.TestTree;
import org.apache.ibatis.annotations.CacheNamespace;
/**
* Mapper
@ -11,7 +9,7 @@ import org.apache.ibatis.annotations.CacheNamespace;
* @author Lion Li
* @date 2021-05-30
*/
@CacheNamespace(implementation = MybatisPlusRedisCache.class, eviction = MybatisPlusRedisCache.class)
//@CacheNamespace(implementation = MybatisPlusRedisCache.class, eviction = MybatisPlusRedisCache.class)
public interface TestTreeMapper extends BaseMapperPlus<TestTree> {
}

@ -5,9 +5,11 @@ import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
import com.ruoyi.common.core.page.PagePlus;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.demo.bo.TestDemoAddBo;
import com.ruoyi.demo.bo.TestDemoEditBo;

@ -33,6 +33,7 @@ public class TestTreeServiceImpl extends ServicePlusImpl<TestTreeMapper, TestTre
return getVoById(id, TestTreeVo.class);
}
// @DataSource(DataSourceType.SLAVE) // 切换从库查询
@DataScope(isUser = true)
@Override
public List<TestTreeVo> queryList(TestTreeQueryBo bo) {

Loading…
Cancel
Save