parent
c6fe6c3c32
commit
09214dd512
@ -0,0 +1,97 @@
|
||||
package com.dsideal.ZhuQue.Util;
|
||||
|
||||
public class ResultVO {
|
||||
private Integer code; //返回码
|
||||
private String msg; //返回提示信息
|
||||
private Object data; //返回数据
|
||||
private boolean success;//是否成功
|
||||
/**
|
||||
* 成功请求
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
public static ResultVO success(Object data){
|
||||
ResultVO res = new ResultVO();
|
||||
res.setCode(1000);
|
||||
res.setSuccess(true);
|
||||
res.setMsg("请求成功");
|
||||
res.setData(data);
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功请求
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
public static ResultVO success(){
|
||||
ResultVO res = new ResultVO();
|
||||
res.setCode(1000);
|
||||
res.setSuccess(true);
|
||||
res.setMsg("请求成功");
|
||||
res.setData(null);
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回自定义数据
|
||||
* @param msg
|
||||
* @param errorCode
|
||||
* @return
|
||||
*/
|
||||
public static ResultVO custom(String msg, int errorCode){
|
||||
ResultVO res = new ResultVO();
|
||||
res.setCode(errorCode);
|
||||
res.setSuccess(false);
|
||||
res.setMsg(msg);
|
||||
res.setData(null);
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回自定义数据
|
||||
* @param msg
|
||||
* @param errorCode
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
public static ResultVO custom(String msg, int errorCode, Object data){
|
||||
ResultVO res = new ResultVO();
|
||||
res.setCode(errorCode);
|
||||
res.setMsg(msg);
|
||||
res.setData(data);
|
||||
return res;
|
||||
}
|
||||
|
||||
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 Object getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(Object data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public boolean isSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(boolean success) {
|
||||
this.success = success;
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
# true 值支持热加载
|
||||
undertow.devMode=false
|
||||
undertow.port=8888
|
||||
undertow.port=9000
|
||||
undertow.host=0.0.0.0
|
||||
#undertow.resourcePath=/usr/local/tomcat8/webapps/QingLong,classpath:static
|
||||
undertow.resourcePath=D:/dsWork/QingLong/WebRoot,classpath:static
|
Loading…
Reference in new issue