标签:users image turn end spring 调用 com jdk autoconf
测试环境:
spring boot 版本 2.0.0.M7
mybatis starter 版本 1.3.1
jdk 1.8
---------------------------------------------------
<!-- 分页插件pagehelper --> <dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper</artifactId> <version>5.0.0</version> </dependency> <dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper-spring-boot-autoconfigure</artifactId> <version>1.2.3</version> </dependency> <dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper-spring-boot-starter</artifactId> <version>1.2.3</version> </dependency> <!-- 分页插件pagehelper -->
参数page为当前页码 、pagesize为每页显示多少条记录
public List<UserEntity> usersList(String loginName, int pageSize, int page) { PageHelper.startPage(page,pageSize); return userDao.usersList(); }
@GetMapping("/users") public PageInfo<UserEntity> usersList(String loginName, int pageSize, int page) { List<UserEntity> list = userService.usersList(loginName,pageSize,page); PageInfo<UserEntity> pageinfo = new PageInfo<UserEntity>(list); log.debug("The method is ending"); return pageinfo; }
下断点调试后 显示 pageinfo的结果为
各项信息都已经显示出来 分页插件加载成功!
标签:users image turn end spring 调用 com jdk autoconf
原文地址:https://www.cnblogs.com/caiba/p/8876104.html