package com.ruoyi.clock.enums;

import com.ruoyi.common.enums.IIntegerEnum;

import java.util.Objects;

/**
 * @author 员工状态
 */
public enum EmployStatusEnum implements IIntegerEnum<String> {

    NORMAL("0", "正常"),
    DISABLE("1", "停用"),
    ;

    private String code;
    private String msg;

    EmployStatusEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Override
    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static EmployStatusEnum getByCode(int code, EmployStatusEnum[] values) {
        for (EmployStatusEnum value : values) {
            if (Objects.equals(code, value.getCode())) {
                return value;
            }
        }
        return null;
    }

}
