0
点赞
收藏
分享

微信扫一扫

通用返回类responseEntity或者ajaxinfo


@Data
public class AjaxInfo {
public AjaxInfo(){

}
public AjaxInfo(Integer code,String msg){
this.code=code;
this.msg=msg;
}

private Integer code=0;

private String msg="操作成功";

private Object data;


public boolean isSuccess( ){
if(0 == code){
return true;
}else{
return false;
}
}

public static void main(String[] args) {
AjaxInfo ajaxInfo = new AjaxInfo();

ajaxInfo.setMsg("找不到页面");
if(ajaxInfo.isSuccess()){

}else{
System.out.println(JSON.toJSONString(ajaxInfo));
}

}
}


举报

相关推荐

0 条评论