wlzboy
2025-09-21 0b80903f3d48b3c39570c097a4334cb7eb71d08f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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;
    }
}