1.在SpringBoot启动项添加分页插件
/**
* 分页插件
*/
@Bean
public PaginationInterceptor paginationInterceptor() {
return new PaginationInterceptor();
}
如图:

2.postman亲测total 和page有值了

3.详情可查询mybatis 源码 看对应的参数和执行流程
本文介绍了如何在SpringBoot项目中集成MybatisPlus的分页插件PaginationInterceptor,通过示例代码展示了配置方法,并通过Postman测试验证了分页效果。详细步骤包括在启动配置中添加分页插件Bean,以及查询结果中出现的total和page等关键信息。同时,文章鼓励读者深入Mybatis源码以理解分页执行流程。
1.在SpringBoot启动项添加分页插件
/**
* 分页插件
*/
@Bean
public PaginationInterceptor paginationInterceptor() {
return new PaginationInterceptor();
}
如图:

2.postman亲测total 和page有值了

3.详情可查询mybatis 源码 看对应的参数和执行流程
784
2万+

被折叠的 条评论
为什么被折叠?