Files
notes_estom/Java/JavaDemo/codedemo/proxy/Result.java
2025-09-14 03:49:42 -04:00

66 lines
1.1 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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 + "]";
}
}