标签:pageinfo dal nav git shm use first artifact ges
依赖导入
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.3.0</version>
</dependency>
测试分页
public Map<String, Object> findAllUser() {
Map<String,Object> map = new HashMap<>();
PageHelper.startPage(1,5);
List<User> userList = userMapper.findAllUser();
PageInfo<User> pageInfo = new PageInfo<>(userList);
map.put("data",pageInfo);
return map;
}
结果
{
data: {
total: 20
list: [
0: {...}
1: {...}
2: {...}
3: {...}
4: {...}
]
pageNum: 1
pageSize: 5
size: 5
startRow: 1
endRow: 5
pages: 4
prePage: 0
nextPage: 2
isFirstPage: true
isLastPage: false
hasPreviousPage: false
hasNextPage: true
navigatePages: 8
navigatepageNums: [...]
navigateFirstPage: 1
navigateLastPage: 4
}
}
标签:pageinfo dal nav git shm use first artifact ges
原文地址:https://www.cnblogs.com/zero-vic/p/14313178.html