package com.judong.chuanyiserver.enums;

public enum OperationEnum {

    UNKNOWN("未知操作", "UNKNOWN"),

    LOGIN("登录", "LOGIN"), LOGOUT("退出登录", "LOGOUT"), UPDATEPASSWORD("修改密码", "UPDATEPASSWORD"),
    ADD("新增", "ADD"), SELECT("查看", "SELECT"), UPDATE("编辑", "UPDATE"), DELETE("删除", "DELETE"),
    ASSIGNROLE("分配角色", "ASSIGNROLE"),
    IMPORT("导入", "IMPORT"), EXPORT("导出", "EXPORT"),
    REGISTER("注册", "REGISTER");

    private String value;

    private String name;

    private OperationEnum(String value, String name) {
        this.value = value;
        this.name = name;
    }

    public static String getName(String name) {
        for (OperationEnum c : OperationEnum.values()) {
            if (c.getName().equalsIgnoreCase(name)) {
                return c.value;
            }
        }
        return "";
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
