add: 周年纪念日
This commit is contained in:
14
src/main/java/com/dota/nexus/entity/Anniversary.java
Normal file
14
src/main/java/com/dota/nexus/entity/Anniversary.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package com.dota.nexus.entity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class Anniversary extends Entity{
|
||||
private LocalDate date;
|
||||
|
||||
private type;
|
||||
}
|
||||
15
src/main/java/com/dota/nexus/entity/AnniversaryEnum.java
Normal file
15
src/main/java/com/dota/nexus/entity/AnniversaryEnum.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package com.dota.nexus.entity;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum AnniversaryEnum {
|
||||
ANNIVERSARY("周年日"),
|
||||
COMMEMORATION("纪念日");
|
||||
|
||||
private String value;
|
||||
|
||||
AnniversaryEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
@@ -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