diff --git a/diboot-core-starter/src/main/java/com/diboot/core/starter/CoreAutoConfiguration.java b/diboot-core-starter/src/main/java/com/diboot/core/starter/CoreAutoConfiguration.java index 8bb6165..8639a24 100644 --- a/diboot-core-starter/src/main/java/com/diboot/core/starter/CoreAutoConfiguration.java +++ b/diboot-core-starter/src/main/java/com/diboot/core/starter/CoreAutoConfiguration.java @@ -18,6 +18,7 @@ package com.diboot.core.starter; import com.alibaba.fastjson.serializer.SerializerFeature; import com.alibaba.fastjson.support.config.FastJsonConfig; import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter; +import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; import com.diboot.core.config.Cons; import com.diboot.core.util.DateConverter; import org.mybatis.spring.annotation.MapperScan; @@ -72,7 +73,7 @@ public class CoreAutoConfiguration implements WebMvcConfigurer { } @Bean - @ConditionalOnMissingBean(HttpMessageConverters.class) + @ConditionalOnMissingBean public HttpMessageConverters fastJsonHttpMessageConverters() { FastJsonHttpMessageConverter converter = new FastJsonHttpMessageConverter(); converter.setDefaultCharset(Charset.forName(Cons.CHARSET_UTF8)); @@ -90,6 +91,16 @@ public class CoreAutoConfiguration implements WebMvcConfigurer { return new HttpMessageConverters(httpMsgConverter); } + /** + * Mybatis-plus分页插件 + */ + @Bean + @ConditionalOnMissingBean + public PaginationInterceptor paginationInterceptor() { + PaginationInterceptor paginationInterceptor = new PaginationInterceptor(); + return paginationInterceptor; + } + /** * 默认支持String-Date类型转换 * @param registry @@ -98,4 +109,5 @@ public class CoreAutoConfiguration implements WebMvcConfigurer { public void addFormatters(FormatterRegistry registry) { registry.addConverter(new DateConverter()); } + } \ No newline at end of file