From 3815fa794633ee7ae2cf81422f72d303777f611f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=9D=E5=85=88=E7=91=9E?= <1490493387@qq.com> Date: Sun, 13 Mar 2022 15:24:17 +0800 Subject: [PATCH] =?UTF-8?q?refactor(PageResult.java):=20=20=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E7=9A=84=E6=80=BB=E6=9D=A1=E6=95=B0=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E8=87=B3data=E7=9A=84total=E5=B1=9E=E6=80=A7=EF=BC=8C=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=88=97=E8=A1=A8=E7=A7=BB=E5=8A=A8=E8=87=B3data?= =?UTF-8?q?=E7=9A=84list=E5=B1=9E=E6=80=A7=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/youlai/common/result/PageResult.java | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/youlai-common/common-core/src/main/java/com/youlai/common/result/PageResult.java b/youlai-common/common-core/src/main/java/com/youlai/common/result/PageResult.java index 278f2843b..c853accf5 100644 --- a/youlai-common/common-core/src/main/java/com/youlai/common/result/PageResult.java +++ b/youlai-common/common-core/src/main/java/com/youlai/common/result/PageResult.java @@ -17,18 +17,30 @@ public class PageResult implements Serializable { private String code; - private List data; - - private long total; + private Data data; private String msg; public static PageResult success(IPage page) { PageResult result = new PageResult<>(); result.setCode(ResultCode.SUCCESS.getCode()); - result.setData(page.getRecords()); - result.setTotal(page.getTotal()); + + Data data = new Data(); + data.setList(page.getRecords()); + data.setTotal(page.getTotal()); + + result.setData(data); result.setMsg(ResultCode.SUCCESS.getMsg()); return result; } + + @lombok.Data + public static class Data { + + private List list; + + private long total; + + } + }