9
9
*
10
10
* @author luna
11
11
*/
12
- public class AjaxResult extends HashMap <String , Object > {
12
+ public class ApiResult extends HashMap <String , Object > {
13
13
private static final long serialVersionUID = 1L ;
14
14
15
15
/**
@@ -56,29 +56,29 @@ public int value() {
56
56
}
57
57
58
58
/**
59
- * 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。
59
+ * 初始化一个新创建的 ApiResult 对象,使其表示一个空消息。
60
60
*/
61
- public AjaxResult () {}
61
+ public ApiResult () {}
62
62
63
63
/**
64
- * 初始化一个新创建的 AjaxResult 对象
64
+ * 初始化一个新创建的 ApiResult 对象
65
65
*
66
66
* @param type 状态类型
67
67
* @param msg 返回内容
68
68
*/
69
- public AjaxResult (Type type , String msg ) {
69
+ public ApiResult (Type type , String msg ) {
70
70
super .put (CODE_TAG , type .value );
71
71
super .put (MSG_TAG , msg );
72
72
}
73
73
74
74
/**
75
- * 初始化一个新创建的 AjaxResult 对象
75
+ * 初始化一个新创建的 ApiResult 对象
76
76
*
77
77
* @param type 状态类型
78
78
* @param msg 返回内容
79
79
* @param data 数据对象
80
80
*/
81
- public AjaxResult (Type type , String msg , Object data ) {
81
+ public ApiResult (Type type , String msg , Object data ) {
82
82
super .put (CODE_TAG , type .value );
83
83
super .put (MSG_TAG , msg );
84
84
if (StringUtils .isNotNull (data )) {
@@ -91,17 +91,17 @@ public AjaxResult(Type type, String msg, Object data) {
91
91
*
92
92
* @return 成功消息
93
93
*/
94
- public static AjaxResult success () {
95
- return AjaxResult .success ("操作成功" );
94
+ public static ApiResult success () {
95
+ return ApiResult .success ("操作成功" );
96
96
}
97
97
98
98
/**
99
99
* 返回成功数据
100
100
*
101
101
* @return 成功消息
102
102
*/
103
- public static AjaxResult success (Object data ) {
104
- return AjaxResult .success ("操作成功" , data );
103
+ public static ApiResult success (Object data ) {
104
+ return ApiResult .success ("操作成功" , data );
105
105
}
106
106
107
107
/**
@@ -110,8 +110,8 @@ public static AjaxResult success(Object data) {
110
110
* @param msg 返回内容
111
111
* @return 成功消息
112
112
*/
113
- public static AjaxResult success (String msg ) {
114
- return AjaxResult .success (msg , null );
113
+ public static ApiResult success (String msg ) {
114
+ return ApiResult .success (msg , null );
115
115
}
116
116
117
117
/**
@@ -121,8 +121,8 @@ public static AjaxResult success(String msg) {
121
121
* @param data 数据对象
122
122
* @return 成功消息
123
123
*/
124
- public static AjaxResult success (String msg , Object data ) {
125
- return new AjaxResult (Type .SUCCESS , msg , data );
124
+ public static ApiResult success (String msg , Object data ) {
125
+ return new ApiResult (Type .SUCCESS , msg , data );
126
126
}
127
127
128
128
/**
@@ -131,8 +131,8 @@ public static AjaxResult success(String msg, Object data) {
131
131
* @param msg 返回内容
132
132
* @return 警告消息
133
133
*/
134
- public static AjaxResult warn (String msg ) {
135
- return AjaxResult .warn (msg , null );
134
+ public static ApiResult warn (String msg ) {
135
+ return ApiResult .warn (msg , null );
136
136
}
137
137
138
138
/**
@@ -142,17 +142,17 @@ public static AjaxResult warn(String msg) {
142
142
* @param data 数据对象
143
143
* @return 警告消息
144
144
*/
145
- public static AjaxResult warn (String msg , Object data ) {
146
- return new AjaxResult (Type .WARN , msg , data );
145
+ public static ApiResult warn (String msg , Object data ) {
146
+ return new ApiResult (Type .WARN , msg , data );
147
147
}
148
148
149
149
/**
150
150
* 返回错误消息
151
151
*
152
152
* @return
153
153
*/
154
- public static AjaxResult error () {
155
- return AjaxResult .error ("操作失败" );
154
+ public static ApiResult error () {
155
+ return ApiResult .error ("操作失败" );
156
156
}
157
157
158
158
/**
@@ -161,8 +161,8 @@ public static AjaxResult error() {
161
161
* @param msg 返回内容
162
162
* @return 警告消息
163
163
*/
164
- public static AjaxResult error (String msg ) {
165
- return AjaxResult .error (msg , null );
164
+ public static ApiResult error (String msg ) {
165
+ return ApiResult .error (msg , null );
166
166
}
167
167
168
168
/**
@@ -172,7 +172,7 @@ public static AjaxResult error(String msg) {
172
172
* @param data 数据对象
173
173
* @return 警告消息
174
174
*/
175
- public static AjaxResult error (String msg , Object data ) {
176
- return new AjaxResult (Type .ERROR , msg , data );
175
+ public static ApiResult error (String msg , Object data ) {
176
+ return new ApiResult (Type .ERROR , msg , data );
177
177
}
178
178
}
0 commit comments