package com.yuchen.saas.manage.user.api.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author 肖祥
 * @date 2022/10/20 17:11
 * 职位类型:1是管理员2是普通员工
 */
@Getter
@AllArgsConstructor
public enum JobEnum {

    ADMIN(1, "管理岗"),

    COMMON(2, "普通岗");

    private Integer code;

    private String description;

    public static String getDescByCode(Integer code) {
        JobEnum[] maskEnumArray = JobEnum.values();
        for (JobEnum maskEnum : maskEnumArray) {
            if (maskEnum.getCode().equals(code)) {
                return maskEnum.getDescription();
            }
        }
        return null;
    }
}
