huminmin
3 天以前 4d853e25a3e28c1a8c92d105729946dd9fd5a191
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
package com.ruoyi.productionPlan.enums;
 
import lombok.Getter;
 
/**
 * <br>
 * 数据方式枚举类
 * </br>
 *
 * @author deslrey
 * @version 1.0
 * @since 2026/03/10 10:36
 */
@Getter
public enum DataSyncTypeEnum {
 
    MANUAL(1, "手动"),
    SCHEDULED(2, "定时");
 
    private final Integer code;
    private final String desc;
 
    DataSyncTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }
 
    public static DataSyncTypeEnum getByCode(Integer code) {
        if (code == null) {
            return null;
        }
        for (DataSyncTypeEnum type : DataSyncTypeEnum.values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return null;
    }
}