package com.sundot.airport.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 角色类型枚举
 */
@Getter
@AllArgsConstructor
public enum RoleTypeEnum {

    admin("admin", "超级管理员"),
    common("common", "普通角色"),
    test("test", "站长"),
    zhijianke("zhijianke", "质检科"),
    jingli("jingli", "经理"),
    xingzheng("xingzheng", "大队行政"),
    kezhang("kezhang", "主管"),
    banzuzhang("banzuzhang", "班组长"),
    SecurityCheck("SecurityCheck", "安检员"),
    guanliyuan("guanliyuan", "管理员"),
    bumenjingli("bumenjingli", "部门经理"),
    ;

    private final String code;
    private final String desc;

    public static RoleTypeEnum getByCode(String code) {
        for (RoleTypeEnum itemEnum : values()) {
            if (itemEnum.getCode().equals(code)) {
                return itemEnum;
            }
        }
        return null;
    }

}
