add: 周年纪念日
This commit is contained in:
@@ -8,15 +8,34 @@ public class R {
|
||||
private String msg;
|
||||
private Object data;
|
||||
|
||||
public R(Integer code, String msg){
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public R (Integer code, String msg, Object data) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public static R ok() {
|
||||
return ok(null);
|
||||
}
|
||||
|
||||
public static R ok(Object data) {
|
||||
var r = new R();
|
||||
r.setCode(200);
|
||||
r.setMsg("ok");
|
||||
r.setData(data);
|
||||
return r;
|
||||
return new R(200, "ok", data);
|
||||
}
|
||||
|
||||
public static R error(){
|
||||
return new R(500, "服务端发生未知错误");
|
||||
}
|
||||
|
||||
public static R unauthorized() {
|
||||
return new R(401, "未授权,客户端没有提供认证信息");
|
||||
}
|
||||
|
||||
public static R forbidden(){
|
||||
return new R(403, "没有权限");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user