com.github.yulichang.springboot.web.log.po.R Maven / Gradle / Ivy
The newest version!
package com.github.yulichang.springboot.web.log.po;
import java.io.Serializable;
import java.util.List;
/**
* 通用结果类
*
* @author yulichang
*/
public class R implements Serializable {
private Integer code;
private String msg;
private Integer count;
private Object data;
public static R ok() {
R r = new R();
r.setCode(0);
r.setMsg("success");
return r;
}
public static R ok(Object obj) {
R r = new R();
r.setCode(0);
r.setMsg("success");
r.setData(obj);
return r;
}
public static R ok(List> list) {
R r = new R();
r.setCode(0);
r.setMsg("success");
r.setCount(list.size());
r.setData(list);
return r;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public Integer getCount() {
return count;
}
public void setCount(Integer count) {
this.count = count;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy