package com.iformall.enums;

/**
 * Created by Stormeye on 2018/08/09.
 */
public enum EnumMsgModelStatus {
    SUCCESS(1, "创建模板成功"),
    FAIL(0, "创建模板失败"),
    REPEAT(-6, "模板已存在"),
    NOT_FOUND(-5, "短信模板不存在"),
    SINATURE_CONTENT_ERROR(-4, "短信签名或内容错误"),
    PARAMETERS_ERROR(-3, "参数错误"),
    MSG_SEND_FAIL(-2, "发送短信失败"),
    INTERFACE_ERROR(-2, "接口请求错误")
    ;

    public static EnumMsgModelStatus getEnum(Integer code) {
        for (EnumMsgModelStatus value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }

    private Integer code;
    private String message;

    EnumMsgModelStatus(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
