干燥机配套车间生产管理系统/云平台服务端
bsw215583320
2024-04-16 c2fccb01b972176dc3da5a497b5e904025e9e98d
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
package org.jeecg.common.constant.enums;
 
import org.jeecg.common.system.annotation.EnumDict;
import org.jeecg.common.system.vo.DictModel;
 
import java.util.ArrayList;
import java.util.List;
 
/**
 * 消息类型
 * @author: jeecg-boot
 */
@EnumDict("messageType")
public enum MessageTypeEnum {
 
    /** 系统消息 */
    XT("system",  "系统消息"),
    /** 邮件消息 */
    YJ("email",  "邮件消息"),
    /** 钉钉消息 */
    DD("dingtalk", "钉钉消息"),
    /** 企业微信 */
    QYWX("wechat_enterprise", "企业微信");
 
    MessageTypeEnum(String type, String note){
        this.type = type;
        this.note = note;
    }
 
    /**
     * 消息类型
     */
    String type;
 
    /**
     * 类型说明
     */
    String note;
 
    public String getNote() {
        return note;
    }
 
    public void setNote(String note) {
        this.note = note;
    }
 
    public String getType() {
        return type;
    }
 
    public void setType(String type) {
        this.type = type;
    }
 
 
    /**
     * 获取字典数据
     * @return
     */
    public static List<DictModel> getDictList(){
        List<DictModel> list = new ArrayList<>();
        DictModel dictModel = null;
        for(MessageTypeEnum e: MessageTypeEnum.values()){
            dictModel = new DictModel();
            dictModel.setValue(e.getType());
            dictModel.setText(e.getNote());
            list.add(dictModel);
        }
        return list;
    }
 
    /**
     * 根据type获取枚举
     *
     * @param type
     * @return
     */
    public static MessageTypeEnum valueOfType(String type) {
        for (MessageTypeEnum e : MessageTypeEnum.values()) {
            if (e.getType().equals(type)) {
                return e;
            }
        }
        return null;
    }
 
}