在Java里很容易做到自定义有状态码和状态说明的枚举类例如: public enum MyStatus { NOT_FOUND(404, "Required resource is not found"); private final int code; private final String msg; private MyStatus (int code, String msg) { this.code= code; this.msg = msg; } public int get…
返回信息类(ResponseInfo): public class ResponseInfo { public static final String Status = "status"; public static final String Info = "info"; private String status; private String info; public String getStatus() { return status; } public vo…