正版包邮spring响应式编程spring
73.3元
包邮
(需用券)
去购买 >
/**
* 响应结构
* @author YLiu
*/
public class ResultUtil {
// 响应业务状态
private Integer status;
// 响应消息
private String msg;
// 响应中的数据
private T data;
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public T getData() {
return data;
}
public void setData(T data) {
this.data = data;
}
public ResultUtil(Integer status, String msg, T data) {
this.status = status;
this.msg = msg;
this.data = data;
}
public ResultUtil(T data) {
this.status = 2000;
this.msg = "success";
this.data = data;
}
public ResultUtil() {
this.status = 2001;
this.msg = "error";
this.data = null;
}
public static ResultUtil success(T data) {
return new ResultUtil(data);
}
public static ResultUtil error(T data) {
return new ResultUtil(2001, "error", data);
}
@Override
public String toString() {
return "ResultUtil [status=" + status + ", msg=" + msg + ", data=" + data + "]";
}
}
原文链接:https://www.cnblogs.com/yliucnblogs/p/9574451.html
java 11官方入门(第8版)教材
79.84元
包邮
(需用券)
去购买 >