package org.springblade.modules.app.common.enums;

/**
 * @author huyinuo
 */

public enum MessageStatusEnum {

    SUCCESS(1, "信息发送成功"),
    FAILED(-1, "信息发送失败"),
    ;

    private int code;
    private String text;

    MessageStatusEnum(int code, String text) {
        this.code = code;
        this.text = text;
    }

    public int getCode() {
        return code;
    }

    public String getText() {
        return text;
    }

    public static MessageStatusEnum findByCode(int code) {
        for (MessageStatusEnum demoEnum : values()) {
            if (code == demoEnum.getCode()) {
                return demoEnum;
            }
        }
        return null;
    }

}
