From 3ced4a8c6610ac7829516a95593b3cf1431c5a81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E8=8B=B1=E6=9D=B0?= <327782001@qq.com> Date: Wed, 12 Jul 2023 00:48:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:Chatbot=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../springbootkwan/controller/ChatbotController.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/kwan/springbootkwan/controller/ChatbotController.java b/src/main/java/com/kwan/springbootkwan/controller/ChatbotController.java index 3695661..56819ce 100644 --- a/src/main/java/com/kwan/springbootkwan/controller/ChatbotController.java +++ b/src/main/java/com/kwan/springbootkwan/controller/ChatbotController.java @@ -52,16 +52,20 @@ public class ChatbotController { return Result.ok(list); } + /** * 分页查询所有数据 * - * @param page 分页对象 - * @param chatbot 查询实体 * @return 所有数据 */ @GetMapping("/page") - public Result selectAll(Page page, Chatbot chatbot) { - return Result.ok(this.chatbotService.page(page, new QueryWrapper<>(chatbot))); + public Result selectAll(@RequestParam Integer page, @RequestParam Integer pageSize) { + Page page1 = new Page<>(); + page1.setCurrent(page); + page1.setSize(pageSize); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.orderByDesc("id"); // 按照 id 字段降序排列 + return Result.ok(this.chatbotService.page(page1, wrapper)); } /** -- GitLab