This commit is contained in:
parent
3c550c72ea
commit
af9aa18353
|
|
@ -0,0 +1,32 @@
|
|||
package com.ruoyi.task.api.enums;
|
||||
|
||||
public enum CycleTypeEnum {
|
||||
DAILY("daily", "日周期"),
|
||||
WEEKLY("weekly", "周周期"),
|
||||
MONTHLY("monthly", "月周期");
|
||||
|
||||
private final String code;
|
||||
private final String name;
|
||||
|
||||
CycleTypeEnum(String code, String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public static CycleTypeEnum getByCode(String code) {
|
||||
for (CycleTypeEnum type : values()) {
|
||||
if (type.code.equals(code)) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.ruoyi.task.api.enums;
|
||||
|
||||
public enum ExecuteTypeEnum {
|
||||
ONCE("once", "单次执行"),
|
||||
CONTINUOUS("continuous", "连续执行");
|
||||
|
||||
private final String code;
|
||||
private final String name;
|
||||
|
||||
ExecuteTypeEnum(String code, String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public static ExecuteTypeEnum getByCode(String code) {
|
||||
for (ExecuteTypeEnum type : values()) {
|
||||
if (type.code.equals(code)) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.ruoyi.task.api.enums;
|
||||
|
||||
public enum PlanTypeEnum {
|
||||
TIMED("timed", "定时任务"),
|
||||
CYCLE("cycle", "周期任务");
|
||||
|
||||
private final String code;
|
||||
private final String name;
|
||||
|
||||
PlanTypeEnum(String code, String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public static PlanTypeEnum getByCode(String code) {
|
||||
for (PlanTypeEnum type : values()) {
|
||||
if (type.code.equals(code)) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.ruoyi.task.api.enums;
|
||||
|
||||
public enum StatusEnum {
|
||||
PENDING("pending", "待执行"),
|
||||
RUNNING("running", "执行中"),
|
||||
COMPLETED("completed", "已完成"),
|
||||
FAILED("failed", "失败"),
|
||||
CANCELED("canceled", "已取消");
|
||||
|
||||
private final String code;
|
||||
private final String name;
|
||||
|
||||
StatusEnum(String code, String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public static StatusEnum getByCode(String code) {
|
||||
for (StatusEnum status : values()) {
|
||||
if (status.code.equals(code)) {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue