一 . 引入依赖
<dependency>
<groupId>com.github.pagehelper
</groupId>
<artifactId>pagehelper-spring-boot-starter
</artifactId>
<version>1.2.13
</version>
</dependency>
二 . service 编写
public PageInfo
<User> getList(int page
, int pageSize
) {
PageHelper
.startPage(page
, pageSize
);
List
<User> list
= userDao
.getList();
PageInfo
<User> userPageInfo
= new PageInfo<>(list
);
return userPageInfo
;
}
转载请注明原文地址:https://tech.qufami.com/read-490.html