mirror of
https://github.com/zongzibinbin/MallChat.git
synced 2026-03-13 21:53:41 +08:00
游标翻页count优化
This commit is contained in:
@@ -25,6 +25,11 @@
|
||||
<artifactId>jtokkit</artifactId>
|
||||
<version>0.6.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>p6spy</groupId>
|
||||
<artifactId>p6spy</artifactId>
|
||||
<version>3.9.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
@@ -31,6 +31,9 @@ public class ChatMessageReq {
|
||||
@NotNull
|
||||
private Integer msgType;
|
||||
|
||||
/**
|
||||
* @see com.abin.mallchat.common.chat.domain.entity.msg
|
||||
*/
|
||||
@ApiModelProperty("消息内容,类型不同传值不同,见https://www.yuque.com/snab/mallcaht/rkb2uz5k1qqdmcmd")
|
||||
@NotNull
|
||||
private Object body;
|
||||
|
||||
@@ -54,7 +54,9 @@ public class CursorUtils {
|
||||
wrapper.lt(cursorColumn, parseCursor(request.getCursor(), cursorType));
|
||||
}
|
||||
wrapper.orderByDesc(cursorColumn);
|
||||
Page<T> page = mapper.page(request.plusPage(), wrapper);
|
||||
Page pageReq = request.plusPage();
|
||||
pageReq.setSearchCount(false);
|
||||
Page<T> page = mapper.page(pageReq, wrapper);
|
||||
String cursor = Optional.ofNullable(CollectionUtil.getLast(page.getRecords()))
|
||||
.map(cursorColumn)
|
||||
.map(CursorUtils::toCursor)
|
||||
|
||||
24
mallchat-chat-server/src/main/resources/spy.properties
Normal file
24
mallchat-chat-server/src/main/resources/spy.properties
Normal file
@@ -0,0 +1,24 @@
|
||||
#3.2.1以上使用
|
||||
modulelist=com.baomidou.mybatisplus.extension.p6spy.MybatisPlusLogFactory,com.p6spy.engine.outage.P6OutageFactory
|
||||
#3.2.1以下使用或者不配置
|
||||
#modulelist=com.p6spy.engine.logging.P6LogFactory,com.p6spy.engine.outage.P6OutageFactory
|
||||
# 自定义日志打印
|
||||
logMessageFormat=com.baomidou.mybatisplus.extension.p6spy.P6SpyLogger
|
||||
#日志输出到控制台
|
||||
appender=com.baomidou.mybatisplus.extension.p6spy.StdoutLogger
|
||||
# 使用日志系统记录 sql
|
||||
#appender=com.p6spy.engine.spy.appender.Slf4JLogger
|
||||
# 设置 p6spy driver 代理
|
||||
deregisterdrivers=true
|
||||
# 取消JDBC URL前缀
|
||||
useprefix=true
|
||||
# 配置记录 Log 例外,可去掉的结果集有error,info,batch,debug,statement,commit,rollback,result,resultset.
|
||||
excludecategories=info,debug,result,commit,resultset
|
||||
# 日期格式
|
||||
dateformat=yyyy-MM-dd HH:mm:ss
|
||||
# 实际驱动可多个
|
||||
#driverlist=org.h2.Driver
|
||||
# 是否开启慢SQL记录
|
||||
outagedetection=true
|
||||
# 慢SQL记录标准 2 秒
|
||||
outagedetectioninterval=2
|
||||
Reference in New Issue
Block a user