From 1693408b73de378156994fc9bd117b88e89c2ed4 Mon Sep 17 00:00:00 2001 From: mazhicheng Date: Thu, 25 Jun 2020 21:02:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=BB=98=E8=AE=A4=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../diboot/core/starter/CoreAutoConfiguration.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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