|
|
@ -80,20 +80,11 @@ public class UserController {
|
|
|
|
|
|
|
|
|
|
|
|
// 用户查看别人发给自己的消息
|
|
|
|
// 用户查看别人发给自己的消息
|
|
|
|
@GetMapping("/getFromMessage")
|
|
|
|
@GetMapping("/getFromMessage")
|
|
|
|
public Result<Page<Message>> getFromMessage(@RequestParam int page, @RequestParam int pageSize) {
|
|
|
|
public Result<List<Message>> getFromMessage(@RequestParam Long id) {
|
|
|
|
if (page <= 0 || pageSize == 0) {
|
|
|
|
|
|
|
|
return new Result<>(400, "页码和每页大小必须大于0", null);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Long id = GetIdUtil.getId();
|
|
|
|
|
|
|
|
Page<Message> messagePage = new Page<>(page, pageSize);
|
|
|
|
|
|
|
|
LambdaQueryWrapper<Message> messageLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
LambdaQueryWrapper<Message> messageLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
// 添加查询条件
|
|
|
|
|
|
|
|
messageLambdaQueryWrapper.eq(Message::getGetUserId, id);
|
|
|
|
messageLambdaQueryWrapper.eq(Message::getGetUserId, id);
|
|
|
|
// 排序条件:先按 mark 对应值排序,然后按时间排序
|
|
|
|
List<Message> list = messageService.list(messageLambdaQueryWrapper);
|
|
|
|
messageLambdaQueryWrapper.orderByDesc(Message::getMark) // mark 值大的排前面
|
|
|
|
return new Result<>(200, "", list);
|
|
|
|
.orderByDesc(Message::getCreateTime); // 时间新的排前面
|
|
|
|
|
|
|
|
messageService.page(messagePage, messageLambdaQueryWrapper);
|
|
|
|
|
|
|
|
return new Result<>(200, "获取成功", messagePage);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 用户确认查看消息
|
|
|
|
// 用户确认查看消息
|
|
|
@ -144,7 +135,7 @@ public class UserController {
|
|
|
|
return new Result<>(200, "", pageInfo);
|
|
|
|
return new Result<>(200, "", pageInfo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 用户寄件
|
|
|
|
// 用户寄件(完成)
|
|
|
|
@PostMapping("/shipment")
|
|
|
|
@PostMapping("/shipment")
|
|
|
|
public Result<String> shipmentExpress(@RequestBody @Validated @NotNull GoodsDTO goodsDTO) {
|
|
|
|
public Result<String> shipmentExpress(@RequestBody @Validated @NotNull GoodsDTO goodsDTO) {
|
|
|
|
// 判断用户是否存在
|
|
|
|
// 判断用户是否存在
|
|
|
|