修改了分页查询订单接口

This commit is contained in:
chen-xin-zhi 2024-11-06 10:23:48 +08:00
parent 4088f26758
commit f8345cd3e8

View File

@ -131,7 +131,7 @@ public class OrderController {
@PostMapping("/list/page")
@Operation(summary = "Web端管理员分页查询订单", description = "参数:订单查询请求体,权限:管理员(admin, boss)方法名listOrder")
@AuthCheck(mustRole = UserConstant.ADMIN_ROLE)
public BaseResponse<List<OrderVO>> listOrder(@RequestBody OrderQueryRequest orderQueryRequest) {
public BaseResponse<Page<OrderVO>> listOrder(@RequestBody OrderQueryRequest orderQueryRequest) {
if (orderQueryRequest == null) {
throw new BusinessException(ErrorCode.PARAMS_ERROR);
}
@ -152,7 +152,13 @@ public class OrderController {
List<OrderItems> list = orderItemService.list(queryWrapper);
orderVO.setOrderItemList(list);
});
return ResultUtils.success(orderVOS);
Page<OrderVO> orderVOPage = new Page<>();
orderVOPage.setRecords(orderVOS);
orderVOPage.setTotal(page.getTotal());
orderVOPage.setPages(page.getPages());
orderVOPage.setCurrent(page.getCurrent());
orderVOPage.setSize(page.getSize());
return ResultUtils.success(orderVOPage);
}