package com.ruoyi.system.domain.enums;
|
|
/**
|
* 任务状态枚举
|
*
|
* @author ruoyi
|
*/
|
public enum TaskStatus {
|
|
/** 待开始 */
|
PENDING("PENDING", "待开始"),
|
|
/** 任务中 */
|
IN_PROGRESS("IN_PROGRESS", "任务中"),
|
|
/** 已完成 */
|
COMPLETED("COMPLETED", "已完成"),
|
|
/** 已取消 */
|
CANCELLED("CANCELLED", "已取消");
|
|
private final String code;
|
private final String info;
|
|
TaskStatus(String code, String info) {
|
this.code = code;
|
this.info = info;
|
}
|
|
public String getCode() {
|
return code;
|
}
|
|
public String getInfo() {
|
return info;
|
}
|
|
public static TaskStatus getByCode(String code) {
|
for (TaskStatus status : values()) {
|
if (status.getCode().equals(code)) {
|
return status;
|
}
|
}
|
return null;
|
}
|
}
|