mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-24 07:19:46 +08:00
update [重大改动] 重写VO转换 支持深拷贝 将VO类抽象到 ServicePlus 泛型处理
This commit is contained in:
@ -17,7 +17,7 @@ import java.util.List;
|
||||
* @author Lion Li
|
||||
* @date 2021-05-30
|
||||
*/
|
||||
public interface ITestDemoService extends IServicePlus<TestDemo> {
|
||||
public interface ITestDemoService extends IServicePlus<TestDemo, TestDemoVo> {
|
||||
|
||||
/**
|
||||
* 查询单个
|
||||
|
@ -16,7 +16,7 @@ import java.util.List;
|
||||
* @author Lion Li
|
||||
* @date 2021-05-30
|
||||
*/
|
||||
public interface ITestTreeService extends IServicePlus<TestTree> {
|
||||
public interface ITestTreeService extends IServicePlus<TestTree, TestTreeVo> {
|
||||
/**
|
||||
* 查询单个
|
||||
* @return
|
||||
|
@ -30,17 +30,17 @@ import java.util.Map;
|
||||
* @date 2021-05-30
|
||||
*/
|
||||
@Service
|
||||
public class TestDemoServiceImpl extends ServicePlusImpl<TestDemoMapper, TestDemo> implements ITestDemoService {
|
||||
public class TestDemoServiceImpl extends ServicePlusImpl<TestDemoMapper, TestDemo, TestDemoVo> implements ITestDemoService {
|
||||
|
||||
@Override
|
||||
public TestDemoVo queryById(Long id) {
|
||||
return getVoById(id, TestDemoVo.class);
|
||||
return getVoById(id);
|
||||
}
|
||||
|
||||
@DataScope(isUser = true)
|
||||
@Override
|
||||
public TableDataInfo<TestDemoVo> queryPageList(TestDemoQueryBo bo) {
|
||||
PagePlus<TestDemo, TestDemoVo> result = pageVo(PageUtils.buildPagePlus(), buildQueryWrapper(bo), TestDemoVo.class);
|
||||
PagePlus<TestDemo, TestDemoVo> result = pageVo(PageUtils.buildPagePlus(), buildQueryWrapper(bo));
|
||||
return PageUtils.buildDataInfo(result);
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ public class TestDemoServiceImpl extends ServicePlusImpl<TestDemoMapper, TestDem
|
||||
@DataScope(isUser = true)
|
||||
@Override
|
||||
public List<TestDemoVo> queryList(TestDemoQueryBo bo) {
|
||||
return listVo(buildQueryWrapper(bo), TestDemoVo.class);
|
||||
return listVo(buildQueryWrapper(bo));
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<TestDemo> buildQueryWrapper(TestDemoQueryBo bo) {
|
||||
|
@ -26,18 +26,18 @@ import java.util.Map;
|
||||
* @date 2021-05-30
|
||||
*/
|
||||
@Service
|
||||
public class TestTreeServiceImpl extends ServicePlusImpl<TestTreeMapper, TestTree> implements ITestTreeService {
|
||||
public class TestTreeServiceImpl extends ServicePlusImpl<TestTreeMapper, TestTree, TestTreeVo> implements ITestTreeService {
|
||||
|
||||
@Override
|
||||
public TestTreeVo queryById(Long id) {
|
||||
return getVoById(id, TestTreeVo.class);
|
||||
return getVoById(id);
|
||||
}
|
||||
|
||||
// @DataSource(DataSourceType.SLAVE) // 切换从库查询
|
||||
@DataScope(isUser = true)
|
||||
@Override
|
||||
public List<TestTreeVo> queryList(TestTreeQueryBo bo) {
|
||||
return listVo(buildQueryWrapper(bo), TestTreeVo.class);
|
||||
return listVo(buildQueryWrapper(bo));
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<TestTree> buildQueryWrapper(TestTreeQueryBo bo) {
|
||||
|
Reference in New Issue
Block a user