zhangherong
3 天以前 8904f9e6005e7e1f3cc06f415fdcde0033c32332
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
package org.jeecg.common.util;
 
import org.apache.commons.lang3.StringUtils;
 
/**
 * @Description: 短信枚举类
 * @author: jeecg-boot
 */
public enum DySmsEnum {
 
    /**登录短信模板编码*/
    LOGIN_TEMPLATE_CODE("SMS_175435174","JEECG","code"),
    /**忘记密码短信模板编码*/
    FORGET_PASSWORD_TEMPLATE_CODE("SMS_175435174","JEECG","code"),
    /**注册账号短信模板编码*/
    REGISTER_TEMPLATE_CODE("SMS_175430166","JEECG","code"),
    /**会议通知*/
    MEET_NOTICE_TEMPLATE_CODE("SMS_201480469","H5活动之家","username,title,minute,time"),
    /**我的计划通知*/
    PLAN_NOTICE_TEMPLATE_CODE("SMS_201470515","H5活动之家","username,title,time");
 
    /**
     * 短信模板编码
     */
    private String templateCode;
    /**
     * 签名
     */
    private String signName;
    /**
     * 短信模板必需的数据名称,多个key以逗号分隔,此处配置作为校验
     */
    private String keys;
    
    private DySmsEnum(String templateCode,String signName,String keys) {
        this.templateCode = templateCode;
        this.signName = signName;
        this.keys = keys;
    }
    
    public String getTemplateCode() {
        return templateCode;
    }
    
    public void setTemplateCode(String templateCode) {
        this.templateCode = templateCode;
    }
    
    public String getSignName() {
        return signName;
    }
    
    public void setSignName(String signName) {
        this.signName = signName;
    }
    
    public String getKeys() {
        return keys;
    }
 
    public void setKeys(String keys) {
        this.keys = keys;
    }
 
    public static DySmsEnum toEnum(String templateCode) {
        if(StringUtils.isEmpty(templateCode)){
            return null;
        }
        for(DySmsEnum item : DySmsEnum.values()) {
            if(item.getTemplateCode().equals(templateCode)) {
                return item;
            }
        }
        return null;
    }
}