package com.boman.domain;

/**
 * @author tjf
 * @Date: 2021/04/22/15:16
 */
public enum RoleEnum {

    A("A","新增"),
    M("M","修改"),
    D("D","删除"),
    Q("Q","查询"),
    S("S","提交"),
    U("U","反提交"),
    I("I","导入"),
    E("E","导出");

    private String role;
    private String name;

    RoleEnum(String role, String name) {
        this.role = role;
        this.name = name;
    }

    public String getRole() {
        return role;
    }

    public String getName() {
        return name;
    }

    /**
     *
     * @param role
     * @return
     */
    public static String getValue(String role) {
        if(null != role){
            for(RoleEnum roleEnum : RoleEnum.values()){
                if(role.equals(roleEnum.getRole())){
                    return roleEnum.getName();
                }
            }
        }
        return null;
    }
}
