fix PageBuilder泛型

V0.5.x
jay 2023-06-01 15:08:01 +08:00
parent f3dbe69e00
commit 6084ef4333
3 changed files with 4 additions and 4 deletions

View File

@ -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);
}

View File

@ -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

View File

@ -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());
}