public class AjaxResult extends LinkedHashMap<String,Object>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Modifier and Type | Field and Description |
|---|---|
static String |
CODE_TAG
状态码
|
static String |
DATA_TAG
数据对象
|
static String |
MSG_TAG
返回内容
|
| Constructor and Description |
|---|
AjaxResult()
初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。
|
AjaxResult(int code,
String msg)
初始化一个新创建的 AjaxResult 对象
|
AjaxResult(int code,
String msg,
Object data)
初始化一个新创建的 AjaxResult 对象
|
| Modifier and Type | Method and Description |
|---|---|
static AjaxResult |
error()
返回错误消息
|
static AjaxResult |
error(int code,
String msg)
返回错误消息
|
static AjaxResult |
error(String msg)
返回错误消息
|
static AjaxResult |
error(String msg,
Object data)
返回错误消息
|
static AjaxResult |
success()
返回成功消息
|
static AjaxResult |
success(Object data)
返回成功数据
|
static AjaxResult |
success(String msg)
返回成功消息
|
static AjaxResult |
success(String msg,
Object data)
返回成功消息
|
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, replaceAll, valuesclone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizeequals, hashCode, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, sizepublic static final String CODE_TAG
public static final String MSG_TAG
public static final String DATA_TAG
public AjaxResult()
public AjaxResult(int code,
String msg)
code - 状态码msg - 返回内容public static AjaxResult success()
public static AjaxResult success(Object data)
data - 响应数据public static AjaxResult success(String msg)
msg - 返回内容public static AjaxResult success(String msg, Object data)
msg - 返回内容data - 数据对象public static AjaxResult error()
public static AjaxResult error(String msg)
msg - 返回内容public static AjaxResult error(String msg, Object data)
msg - 返回内容data - 数据对象public static AjaxResult error(int code, String msg)
code - 状态码msg - 返回内容Copyright © 2021. All rights reserved.