/**
* @Author : 初bai
* @Date : 2022/3/23 18:01
* @Description : 返回结果类
*/
@Data
public class ReponseResult implements Serializable {
private int code; //200为正常 400异常
private String msg;
private Object data;
public static ReponseResult success(Object data){
return result(200," *** 作成功",data);
}
public static ReponseResult success(String msg, Object data){
return result(200,msg,data);
}
public static ReponseResult fail(String msg){
return result(400,msg,null);
}
public static ReponseResult fail(String msg, Object data){
return result(400,msg,data);
}
public static ReponseResult result(int code, String msg, Object data){
ReponseResult res = new ReponseResult();
res.setCode(code);
res.setMsg(msg);
res.setData(data);
return res;
}
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)