package com.mvc.constant;

/**
 * 操作类型(操作日志使用)
 */
public enum OperationType {
    REGISTRATION(0,"注册"),
    LOGIN(1,"登录"),
    CHANGE_PWD(2,"修改密码")
    ;

    private int flag;
    private String desc;

    OperationType(int flag, String desc) {
        this.flag = flag;
        this.desc = desc;
    }

    public int getFlag() {
        return flag;
    }

    public void setFlag(int flag) {
        this.flag = flag;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static OperationType findOperationTypeByflag(int flag){
        for (OperationType alarmType: OperationType.values()) {
            if (alarmType.flag==flag) {
                return  alarmType;
            }
        }
        return null;
    }
}
