fix PageBuilder泛型
parent
f3dbe69e00
commit
6084ef4333
|
@ -77,7 +77,7 @@ public class SysConfigDataImpl implements ISysConfigData, IJPACommData<SysConfig
|
|||
.and(StringUtils.isNotEmpty(query.getConfigKey()), () -> tbSysConfig.configKey.like(query.getConfigKey()))
|
||||
.build();
|
||||
Page<TbSysConfig> all = baseRepository.findAll(predicate, PageBuilder.toPageable(pageRequest));
|
||||
return PageBuilder.toPaging(all, SysConfig.class);
|
||||
return PageBuilder.toPaging(all, SysConfig.class);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ public class SysLogininfoDataImpl implements ISysLogininforData, IJPACommData<Sy
|
|||
@Override
|
||||
public Paging<SysLogininfor> findByConditions(SysLogininfor cond, int page, int size) {
|
||||
Page<TbSysLogininfor> all = logininfoRepository.findAll(genPredicate(cond), PageBuilder.buildPageable(page, size));
|
||||
return PageBuilder.toPaging(all, SysConfig.class);
|
||||
return PageBuilder.toPaging(all, SysLogininfor.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -65,12 +65,12 @@ public class PageBuilder {
|
|||
return orders;
|
||||
}
|
||||
|
||||
public static Paging toPaging(Page all, Class clz) {
|
||||
public static <T> Paging<T> toPaging(Page all, Class clz) {
|
||||
return new Paging<>(all.getTotalElements(),
|
||||
MapstructUtils.convert(all.getContent(), clz));
|
||||
}
|
||||
|
||||
public static Paging<?> toPaging(Page all) {
|
||||
public static <T> Paging<T> toPaging(Page all) {
|
||||
return new Paging<>(all.getTotalElements(), all.getContent());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue