add: 目标crud
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
package com.dota.nexus.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class Entity {
|
||||
@TableId(type = IdType.AUTO)
|
||||
Integer id;
|
||||
|
||||
Integer status;
|
||||
|
||||
LocalDateTime createTime;
|
||||
|
||||
LocalDateTime updateTime;
|
||||
|
||||
@@ -6,6 +6,8 @@ import lombok.EqualsAndHashCode;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class Goal extends Entity {
|
||||
private GoalEnum status;
|
||||
|
||||
private String name;
|
||||
|
||||
private String tag;
|
||||
|
||||
16
src/main/java/com/dota/nexus/entity/GoalEnum.java
Normal file
16
src/main/java/com/dota/nexus/entity/GoalEnum.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package com.dota.nexus.entity;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum GoalEnum {
|
||||
DOING("进行中"),
|
||||
DONE("完成"),
|
||||
CANCEL("已取消");
|
||||
|
||||
private final String value;
|
||||
|
||||
GoalEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
22
src/main/java/com/dota/nexus/entity/R.java
Normal file
22
src/main/java/com/dota/nexus/entity/R.java
Normal file
@@ -0,0 +1,22 @@
|
||||
package com.dota.nexus.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class R {
|
||||
private Integer code;
|
||||
private String msg;
|
||||
private Object 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user