feat:mybatisPlus增强

dev-captcha
wangxy 11 months ago
parent a500900a89
commit 7601783018

@ -23,8 +23,7 @@ import org.springframework.context.annotation.Bean;
public class MybatisPlusConfig { public class MybatisPlusConfig {
@Bean @Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() public MybatisPlusInterceptor mybatisPlusInterceptor() {
{
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
// 分页插件 // 分页插件
interceptor.addInnerInterceptor(paginationInnerInterceptor()); interceptor.addInnerInterceptor(paginationInnerInterceptor());
@ -38,8 +37,7 @@ public class MybatisPlusConfig {
/** /**
* https://baomidou.com/guide/interceptor-pagination.html * https://baomidou.com/guide/interceptor-pagination.html
*/ */
public PaginationInnerInterceptor paginationInnerInterceptor() public PaginationInnerInterceptor paginationInnerInterceptor() {
{
PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor(); PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor();
// 设置数据库类型为mysql // 设置数据库类型为mysql
paginationInnerInterceptor.setDbType(DbType.MYSQL); paginationInnerInterceptor.setDbType(DbType.MYSQL);
@ -51,16 +49,14 @@ public class MybatisPlusConfig {
/** /**
* https://baomidou.com/guide/interceptor-optimistic-locker.html * https://baomidou.com/guide/interceptor-optimistic-locker.html
*/ */
public OptimisticLockerInnerInterceptor optimisticLockerInnerInterceptor() public OptimisticLockerInnerInterceptor optimisticLockerInnerInterceptor() {
{
return new OptimisticLockerInnerInterceptor(); return new OptimisticLockerInnerInterceptor();
} }
/** /**
* https://baomidou.com/guide/interceptor-block-attack.html * https://baomidou.com/guide/interceptor-block-attack.html
*/ */
public BlockAttackInnerInterceptor blockAttackInnerInterceptor() public BlockAttackInnerInterceptor blockAttackInnerInterceptor() {
{
return new BlockAttackInnerInterceptor(); return new BlockAttackInnerInterceptor();
} }
} }

Loading…
Cancel
Save