From c5011726949d16828c9ded8ee9d104fab2f4efae Mon Sep 17 00:00:00 2001 From: puhui999 Date: Mon, 18 Nov 2024 17:20:46 +0800 Subject: [PATCH] 【功能完善】商城:客服消息查询 pageSize 改 limit --- yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/kefu/vo/message/KeFuMessageListReqVO.java | 13 ++++++------- yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/kefu/vo/message/AppKeFuMessagePageReqVO.java | 12 ++++++------ yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/kefu/KeFuMessageMapper.java | 2 +- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/kefu/vo/message/KeFuMessageListReqVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/kefu/vo/message/KeFuMessageListReqVO.java index 48ba643..25b8f49 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/kefu/vo/message/KeFuMessageListReqVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/kefu/vo/message/KeFuMessageListReqVO.java @@ -15,7 +15,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @Data public class KeFuMessageListReqVO { - private static final Integer PAGE_SIZE = 10; + private static final Integer LIMIT = 10; @Schema(description = "会话编号", example = "12580") @NotNull(message = "会话编号不能为空") @@ -25,11 +25,10 @@ public class KeFuMessageListReqVO { @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime createTime; - // TODO @puhui999:这种一般建议叫 limit。不用 pageSize 哈 - @Schema(description = "每页条数,最大值为 100", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") - @NotNull(message = "每页条数不能为空") - @Min(value = 1, message = "每页条数最小值为 1") - @Max(value = 100, message = "每页条数最大值为 100") - private Integer pageSize = PAGE_SIZE; + @Schema(description = "每次查询条数,最大值为 100", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") + @NotNull(message = "每次查询条数不能为空") + @Min(value = 1, message = "每次查询条数最小值为 1") + @Max(value = 100, message = "每次查询最大值为 100") + private Integer limit = LIMIT; } \ No newline at end of file diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/kefu/vo/message/AppKeFuMessagePageReqVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/kefu/vo/message/AppKeFuMessagePageReqVO.java index 7a55bef..78b105a 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/kefu/vo/message/AppKeFuMessagePageReqVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/kefu/vo/message/AppKeFuMessagePageReqVO.java @@ -15,7 +15,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @Data public class AppKeFuMessagePageReqVO { - private static final Integer PAGE_SIZE = 10; + private static final Integer LIMIT = 10; @Schema(description = "会话编号", example = "12580") private Long conversationId; @@ -24,10 +24,10 @@ public class AppKeFuMessagePageReqVO { @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime createTime; - @Schema(description = "每页条数,最大值为 100", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") - @NotNull(message = "每页条数不能为空") - @Min(value = 1, message = "每页条数最小值为 1") - @Max(value = 100, message = "每页条数最大值为 100") - private Integer pageSize = PAGE_SIZE; + @Schema(description = "每次查询条数,最大值为 100", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") + @NotNull(message = "每次查询条数不能为空") + @Min(value = 1, message = "每次查询条数最小值为 1") + @Max(value = 100, message = "每次查询最大值为 100") + private Integer limit = LIMIT; } \ No newline at end of file diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/kefu/KeFuMessageMapper.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/kefu/KeFuMessageMapper.java index a720419..a7753b3 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/kefu/KeFuMessageMapper.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/mysql/kefu/KeFuMessageMapper.java @@ -32,7 +32,7 @@ public interface KeFuMessageMapper extends BaseMapperX { .eqIfPresent("conversation_id", reqVO.getConversationId()) .ltIfPresent("create_time", reqVO.getCreateTime()) .orderByDesc("create_time") - .limitN(reqVO.getPageSize())); + .limitN(reqVO.getLimit())); } default List selectListByConversationIdAndUserTypeAndReadStatus(Long conversationId, Integer userType, -- libgit2 0.21.4