Skip to content

Jason-Chen-2017/pagehelper-spring-boot

 
 

Repository files navigation

PageHelper integration with Spring Boot

PageHelper-Spring-Boot-Starter 帮助你集成分页插件到 Spring Boot。

PageHelper-Spring-Boot-Starter will help you use PageHelper with Spring Boot.

Support PageHelper 5.x

How to use

在 pom.xml 中添加如下依赖:

Add the following dependency to your pom.xml:

<dependency>
    <groupId>com.github.pagehelper</groupId>
    <artifactId>pagehelper-spring-boot-starter</artifactId>
    <version>1.1.0</version>
</dependency>

v1.1.0 - 2017-02-04

  • 解决可能会注册两次分页插件的问题。
  • 增加 PageHelperProperties 注入,常用属性可以通过 IDE 自动提示

IDE 自动提示

Example

https://github.com/abel533/MyBatis-Spring-Boot

PageHelper

https://github.com/pagehelper/Mybatis-PageHelper

Special Configurations

一般情况下,你不需要做任何配置。

Normally, you don't need to do any configuration.

如果需要配置,可以使用如下方式进行配置:

You can config PageHelper as the following:

application.properties:

pagehelper.propertyName=propertyValue

注意 pagehelper 配置,因为分页插件根据自己的扩展不同,支持的参数也不同,所以不能用固定的对象接收参数,所以这里使用的 Map<String,String>,因此参数名是什么这里就写什么,IDE 也不会有自动提示。

关于可配置的属性请参考 如何使用分页插件

You can configure the properties of the reference here How to use the PageHelper.

Interceptor Order

如果你想要控制 拦截器插件的顺序,可以通过下面注解控制:

If you want to control the order in which the interceptor plug-in, you can use the following annotation control:

@AutoConfigureAfter(PageHelperAutoConfiguration.class)
//Or
@AutoConfigureBefore(PageHelperAutoConfiguration.class)

About

pagehelper-spring-boot

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%