package com.kcim.common.enums;

import java.util.Objects;

/**
 * 权限枚举
 */
public enum PermissionEnum {
    ADMIN(1, "管理员"),
    CHECK_MANAGER(2, "查核组长"),
    CHECK_MAN(3, "查核组员"),
    DEPT_MANAGER(4, "单位负责人"),
    IMPROVER(5, "改善者"),
    ;

    private Integer key;

    private String value;

    PermissionEnum(Integer key, String value) {
        this.key = key;
        this.value = value;
    }

    public Integer getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

    public static String getByCode(Integer key) {
        for (PermissionEnum jobUserTypeEnum : PermissionEnum.values()) {
            if (Objects.equals(key, jobUserTypeEnum.key)) {
                return jobUserTypeEnum.value;
            }
        }
        return null;
    }
}
