add: 周年纪念日

This commit is contained in:
jsh
2025-10-11 16:18:18 +08:00
parent 8a120a7223
commit ef224aa546
10 changed files with 136 additions and 14 deletions

View File

@@ -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, "没有权限");
}
}