2026-04-27 10:27:57 +08:00
|
|
|
package com.labelsys.backend.config;
|
|
|
|
|
|
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
|
|
2026-04-27 16:25:39 +08:00
|
|
|
import com.baomidou.mybatisplus.annotation.DbType;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
|
|
|
|
|
2026-04-27 10:27:57 +08:00
|
|
|
@Configuration
|
|
|
|
|
public class MybatisPlusConfig {
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
|
public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
|
|
|
|
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
2026-04-27 16:25:39 +08:00
|
|
|
PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor(DbType.POSTGRE_SQL);
|
|
|
|
|
paginationInnerInterceptor.setOverflow(false);
|
|
|
|
|
paginationInnerInterceptor.setMaxLimit(200L);
|
|
|
|
|
interceptor.addInnerInterceptor(paginationInnerInterceptor);
|
|
|
|
|
|
2026-04-27 10:27:57 +08:00
|
|
|
return interceptor;
|
|
|
|
|
}
|
|
|
|
|
}
|