From e8d409bd3842cf3f19658b0efe36840100664b0a Mon Sep 17 00:00:00 2001 From: yjxx <1055683039@qq.com> Date: Wed, 13 Nov 2024 16:42:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=A8=E6=88=B7=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E5=88=AB=E4=BA=BA=E5=8F=91=E7=BB=99=E8=87=AA=E5=B7=B1?= =?UTF-8?q?=E7=9A=84=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/UserController.java | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/main/java/jty/expressdistributionsystem/controller/UserController.java b/src/main/java/jty/expressdistributionsystem/controller/UserController.java index 6af7f2b..ea25d23 100644 --- a/src/main/java/jty/expressdistributionsystem/controller/UserController.java +++ b/src/main/java/jty/expressdistributionsystem/controller/UserController.java @@ -80,20 +80,11 @@ public class UserController { // 用户查看别人发给自己的消息 @GetMapping("/getFromMessage") - public Result> getFromMessage(@RequestParam int page, @RequestParam int pageSize) { - if (page <= 0 || pageSize == 0) { - return new Result<>(400, "页码和每页大小必须大于0", null); - } - Long id = GetIdUtil.getId(); - Page messagePage = new Page<>(page, pageSize); + public Result> getFromMessage(@RequestParam Long id) { LambdaQueryWrapper messageLambdaQueryWrapper = new LambdaQueryWrapper<>(); - // 添加查询条件 messageLambdaQueryWrapper.eq(Message::getGetUserId, id); - // 排序条件:先按 mark 对应值排序,然后按时间排序 - messageLambdaQueryWrapper.orderByDesc(Message::getMark) // mark 值大的排前面 - .orderByDesc(Message::getCreateTime); // 时间新的排前面 - messageService.page(messagePage, messageLambdaQueryWrapper); - return new Result<>(200, "获取成功", messagePage); + List list = messageService.list(messageLambdaQueryWrapper); + return new Result<>(200, "", list); } // 用户确认查看消息 @@ -144,7 +135,7 @@ public class UserController { return new Result<>(200, "", pageInfo); } - // 用户寄件 + // 用户寄件(完成) @PostMapping("/shipment") public Result shipmentExpress(@RequestBody @Validated @NotNull GoodsDTO goodsDTO) { // 判断用户是否存在