You've already forked FrameTour-BE
27 lines
747 B
Java
27 lines
747 B
Java
package com.ycwl.basic.config;
|
|
|
|
import com.github.pagehelper.PageInterceptor;
|
|
import org.springframework.context.annotation.Bean;
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
import java.util.Properties;
|
|
|
|
/**
|
|
* @date 2022年05月18日 15:43
|
|
* PageHelper配置类
|
|
*/
|
|
@Configuration
|
|
public class PageHelperConfig {
|
|
|
|
@Bean(name = "pageHelper")
|
|
public PageInterceptor pageHelper() {
|
|
PageInterceptor pageHelper = new PageInterceptor();
|
|
Properties properties = new Properties();
|
|
properties.setProperty("reasonable", "false");
|
|
// 配置数据库的方言
|
|
properties.setProperty("helperDialect", "mysql");
|
|
pageHelper.setProperties(properties);
|
|
return pageHelper;
|
|
}
|
|
}
|