Skip to content

Commit d102ca5

Browse files
dc444joey-zhou
authored andcommitted
AjaxResult增加字段数据获取方法
1 parent 057ecfd commit d102ca5

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/main/java/com/xiaozhi/common/web/AjaxResult.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package com.xiaozhi.common.web;
22

3-
import java.util.HashMap;
4-
53
import org.springframework.util.ObjectUtils;
64

5+
import java.util.HashMap;
6+
77
/**
88
* API返回封装
99
*
@@ -144,4 +144,16 @@ public static AjaxResult error(int code, String msg) {
144144
public static AjaxResult error(int code, String msg, Object data) {
145145
return new AjaxResult(code, msg, data);
146146
}
147+
148+
public int getCode() {
149+
return (int) super.get(CODE_TAG);
150+
}
151+
152+
public String getMessage() {
153+
return (String) super.get(MSG_TAG);
154+
}
155+
156+
public Object getData() {
157+
return super.get(DATA_TAG);
158+
}
147159
}

0 commit comments

Comments
 (0)