task
This commit is contained in:
parent
3a9b077abe
commit
da059bf1ad
|
|
@ -0,0 +1,32 @@
|
|||
package com.ruoyi.task.api.enums;
|
||||
|
||||
public enum TaskCategoryEnum {
|
||||
MANUAL_FLIGHT("manual_flight", "人工执飞"),
|
||||
PLAN_TASK("plan_task", "计划任务"),
|
||||
EMERGENCY_TASK("emergency_task", "紧急任务");
|
||||
|
||||
private final String code;
|
||||
private final String name;
|
||||
|
||||
TaskCategoryEnum(String code, String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public static TaskCategoryEnum getByCode(String code) {
|
||||
for (TaskCategoryEnum category : values()) {
|
||||
if (category.code.equals(code)) {
|
||||
return category;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.ruoyi.task.api.enums;
|
||||
|
||||
public enum TaskTypeEnum {
|
||||
ONE_CLICK_TAKE_OFF("one_click_take_off", "一键起飞"),
|
||||
PLAN_TASK("plan_task", "计划任务"),
|
||||
MANUAL_FLIGHT("manual_flight", "人工执飞");
|
||||
|
||||
private final String code;
|
||||
private final String name;
|
||||
|
||||
TaskTypeEnum(String code, String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public static TaskTypeEnum getByCode(String code) {
|
||||
for (TaskTypeEnum type : values()) {
|
||||
if (type.code.equals(code)) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue