SpringBoot分页
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-autoconfigure</artifactId>
<version>1.2.3</version>
</dependency>
select * from user
PageInfo<TestDao> TeseDao(int pageNum, int pageSize);
@Override
public PageInfo<TestDao> TeseService(int pageNum, int pageSize) {
PageHelper.startPage(pageNum, pageSize);
List<TestDao> lists = testServiceMapper.TeseDao();
PageInfo<TestDao> pageInfo = new PageInfo<>(lists);
return pageInfo;
}
@PostMapping(value = "/user")
public PageInfo<TestDao> TestControoler(){
PageInfo<TestDao> query = testService.TeseService(1, 2);
return query;
}