Skip to content

Commit

Permalink
refactor: 优化分页总记录数数据类型
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles7c committed Aug 31, 2023
1 parent 015ff55 commit bfea689
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class PageDataVO<V> implements Serializable {
* 总记录数
*/
@Schema(description = "总记录数", example = "10")
private int total;
private long total;

/**
* 基于 MyBatis Plus 分页数据构建分页信息,并将源数据转换为指定类型数据
Expand All @@ -74,7 +74,7 @@ public static <T, V> PageDataVO<V> build(IPage<T> page, Class<V> targetClass) {
}
PageDataVO<V> pageDataVO = new PageDataVO<>();
pageDataVO.setList(BeanUtil.copyToList(page.getRecords(), targetClass));
pageDataVO.setTotal((int)page.getTotal());
pageDataVO.setTotal(page.getTotal());
return pageDataVO;
}

Expand All @@ -93,7 +93,7 @@ public static <V> PageDataVO<V> build(IPage<V> page) {
}
PageDataVO<V> pageDataVO = new PageDataVO<>();
pageDataVO.setList(page.getRecords());
pageDataVO.setTotal((int)page.getTotal());
pageDataVO.setTotal(page.getTotal());
return pageDataVO;
}

Expand Down

0 comments on commit bfea689

Please sign in to comment.