我是这样处理的
public class Result<T> {
/**
* 状态码.
*/
private Integer code;
/**
* 提示信息
*/
private String msg;
/**
* 具体内容
*/
private T data;
/**
* @return the code
*/
public Integer getCode() {
return code;
}
/**
* @param code
* the code to set
*/
public void setCode(Integer code) {
this.code = code;
}
/**
* @return the msg
*/
public String getMsg() {
return msg;
}
/**
* @param msg
* the msg to set
*/
public void setMsg(String msg) {
this.msg = msg;
}
/**
* @return the data
*/
public T getData() {
return data;
}
/**
* @param data
* the data to set
*/
public void setData(T data) {
this.data = data;
}
}