mybatis-plus最新版配置分页最大限制条数
发表于|更新于
|浏览量:
价值产生信心,信心产生热忱,而热忱则征服世界。——华特·H·柯亭姆
开发中,我们对于分页,经验老道的程序员会限制分页最大数据条数,避免被攻击、或是数据量太大造成各种可避免问题
mybatis-plus中配置分页最大限制非常容易,在配置分页的地方
加上如下代码即可
1 | final PaginationInnerInterceptor innerInterceptor = new PaginationInnerInterceptor(DbType.MYSQL); |

全部代码配置在我之前的博客可以找到
相关推荐
2021-06-11
redis的manager层应用
一身报国有万死,双鬓向人无再青。 —— 陆游 封装了一个操作redis的管理层,简单处理了缓存穿透、击穿、雪崩问题 Manager 12345678910111213141516171819202122232425package com.ruben.manager;import com.alibaba.fastjson.TypeReference;import java.util.function.Supplier;/** * redis管理层 * * @author <achao1441470436@gmail.com> * @since 2021/6/11 0011 21:55 */public interface RedisManager { /** * 从缓存中获取否则从mysql中查询 * * @param key 缓存中的key * @param mysqlSupplier 查询mysql操作 * @param typeReference 返回的类型 * @param ...
2020-07-14
Gitlab的安装
Gitlab安装1.安装相关依赖 1yum -y install policycoreutils openssh-server openssh-clients postfix 2.启动ssh服务&设置为开机启动 1systemctl enable sshd && sudo systemctl start sshd 3.设置postfix开机自启,并启动,postfix支持gitlab发信功能 1systemctl enable postfix && sudo systemctl start postfix 如果报这个错 1Job for postfix.service failed because the control process exited with error code. See "systemctl status postfix.service" and "journalctl -xe" for details. 可以采取以下解决方案 1234#修改 /etc/postfix/m...
2020-11-18
使用stream流连接两个list
生命如同寓言,其价值不在于长短,而在于内容—— 塞涅卡 1234567List<Integer> integerList = Arrays.stream(new int[]{1, 2, 3}).boxed().collect(Collectors.toList());List<Integer> collect = Stream.concat(integerList.stream(), integerList.stream()).collect(Collectors.toList());collect.forEach(System.out::print);System.out.println();collect = Stream.of(integerList, integerList).flatMap(List::stream).collect(Collectors.toList());collect.forEach(System.out::print);System.out.println();
2020-07-18
Maven常用镜像配置
分享一下Maven阿里云常用镜像仓库settings.xml 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394<?xml version="1.0" encoding="UTF-8"?><settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://...
2021-12-06
Collectors.toMap空指针问题
社会上崇敬名人,于是以为名人的话就是名言,却忘记了他所以得名是那一种学问和事业。 —— 鲁迅 对于Collectors.toMap,我们使用时如果value为空,则会抛出空指针,因为底层调用的Map.merge函数 如果我们想避免该问题,就可以使用collect去处理,例如我给hutool提交的这个PR一样 原先: 1StreamUtil.of(collection, isParallel).collect(Collectors.toMap(key, value, (l, r) -> l)); 现在: 1StreamUtil.of(collection, isParallel).collect(HashMap::new, (HashMap<K, V> m, E v) -> m.put(key.apply(v), value.apply(v)), HashMap::putAll); 完整函数: 12345678910111213141516/** * @param collection 需要转化的集合 * @param key E类型转...
2022-05-15
引入一个boot模块坑
“所有你乐于挥霍的时间都不能算作是浪费。”——约翰·列侬 这个坑蛮棘手的 事发场景:main-boot引入common-boot模块,common-boot模块是一个spring-boot模块 关键GAV构成如下: common-boot 12345678910111213141516171819<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.6.7</version> <relativePath/></parent><groupId>com.ruben</groupId><artifactId>common-boot</artifactId><version>0.0.1-SNAPSHOT</ver...

阿超
我的名字叫阿超 年龄25岁 家在北京市 职业是软件开发 每天最晚也会在八点前回家 不抽烟 酒浅尝辄止 晚上十二点上床 保证睡足八个小时 睡前写一篇博客 再做二十分钟俯卧撑暖身 然后再睡觉 基本能熟睡到天亮 像婴儿一样不留下任何疲劳和压力 就这样迎来第二天的早晨 健康检查结果也显示我很正常 我想说明我是一个不论何时都追求内心平稳的人 不拘泥于胜负 不纠结于烦恼 不树立使我夜不能寐的敌人 这就是我在这社会的生活态度
Follow Me公告
This is my Blog