mirror of
https://github.com/Estom/notes.git
synced 2026-02-04 11:04:21 +08:00
Java内容重新整理删除过期的东西
This commit is contained in:
65
Java/JavaDemo/codedemo/proxy/Result.java
Normal file
65
Java/JavaDemo/codedemo/proxy/Result.java
Normal file
@@ -0,0 +1,65 @@
|
||||
package cn.aofeng.demo.proxy;
|
||||
|
||||
/**
|
||||
* 账号服务操作结果。
|
||||
*
|
||||
* @author <a href="mailto:aofengblog@163.com">聂勇</a>
|
||||
*/
|
||||
public class Result {
|
||||
|
||||
/**
|
||||
* 200xxxx 表示成功。<br/>
|
||||
* 400xxxx 表示参数错误。<br/>
|
||||
* 500xxxx 表示服务内部错误。
|
||||
*/
|
||||
private int code;
|
||||
|
||||
/**
|
||||
* code对应的描述信息。
|
||||
*/
|
||||
private String msg;
|
||||
|
||||
/**
|
||||
* 只有code为200xxxx时才有值,其他情况下为null。
|
||||
*/
|
||||
private User data;
|
||||
|
||||
public Result() {
|
||||
// nothing
|
||||
}
|
||||
|
||||
public Result(int code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public User getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(User data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Result [code=" + code + ", msg=" + msg + ", data=" + data + "]";
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user