Commit f88f8d21583397e90003416fd4d69c449daeef02

Authored by zhangxiaoxiang
1 parent d8e16104

refactor(yudao-common):调整 CommonResult 和 PageResult 类的属性顺序

-调整 CommonResult 类中 code、msg 和 data 属性的顺序,使代码结构更合理
-调整 PageResult 类中 total 和 list 属性的顺序,符合常规的数据结构展示逻辑
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/CommonResult.java
@@ -26,15 +26,15 @@ public class CommonResult<T> implements Serializable { @@ -26,15 +26,15 @@ public class CommonResult<T> implements Serializable {
26 */ 26 */
27 private Integer code; 27 private Integer code;
28 /** 28 /**
29 - * 返回数据  
30 - */  
31 - private T data;  
32 - /**  
33 * 错误提示,用户可阅读 29 * 错误提示,用户可阅读
34 * 30 *
35 * @see ErrorCode#getMsg() () 31 * @see ErrorCode#getMsg() ()
36 */ 32 */
37 private String msg; 33 private String msg;
  34 + /**
  35 + * 返回数据
  36 + */
  37 + private T data;
38 38
39 /** 39 /**
40 * 将传入的 result 对象,转换成另外一个泛型结果的对象 40 * 将传入的 result 对象,转换成另外一个泛型结果的对象
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/pojo/PageResult.java
@@ -11,12 +11,12 @@ import java.util.List; @@ -11,12 +11,12 @@ import java.util.List;
11 @Data 11 @Data
12 public final class PageResult<T> implements Serializable { 12 public final class PageResult<T> implements Serializable {
13 13
14 - @Schema(description = "数据", requiredMode = Schema.RequiredMode.REQUIRED)  
15 - private List<T> list;  
16 -  
17 @Schema(description = "总量", requiredMode = Schema.RequiredMode.REQUIRED) 14 @Schema(description = "总量", requiredMode = Schema.RequiredMode.REQUIRED)
18 private Long total; 15 private Long total;
19 16
  17 + @Schema(description = "数据", requiredMode = Schema.RequiredMode.REQUIRED)
  18 + private List<T> list;
  19 +
20 public PageResult() { 20 public PageResult() {
21 } 21 }
22 22