package com.njcn.enums.app;

/**
 * @author hongawen
 * @date: 2019/10/22 14:05
 * 短信模板枚举
 */
public enum MessageEnum {
    /**
     * 阿里云短信模板编号
     */
    LOGIN(0, "SMS_176180086"), REGISTER(1, "SMS_176200101"),
    RESET_PWD(2, "SMS_176195072"),
    FORGET_PWD(3, "SMS_176195072"), UPDATE_PHONE(4, "SMS_175583840"),
    JUDGE_OLD_PHONE(5, "SMS_176195072"),EVENT_MESSAGE_NOTICE(6,"SMS_212270827");

    private int code;

    private String templateCode;

    MessageEnum(int code, String templateCode) {
        this.code = code;
        this.templateCode = templateCode;
    }

    public int getCode() {
        return code;
    }

    public String getTemplateCode() {
        return templateCode;
    }

    public static String getTemplateByCode(int code) {
        for (MessageEnum messageEnum : MessageEnum.values()) {
            if (messageEnum.code == code) {
                return messageEnum.templateCode;
            }
        }
        return "";
    }

}
