package jnpf.enums.attendance;

import lombok.Getter;

/**
 * describe
 *
 * @author HuangLinPan
 * @date 2023/12/15
 */
@Getter
public enum UserSettingTypeEnum {
    // 1 是 0 否
    USER(1, "个人"),
    GROUP(2, "考勤组"),
    WEB_MESSAGE_SETTING(3, "消息设置"),
    ;
    Integer code;
    String msg;

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

    public Integer getCode() {
        return code;
    }

    public static String getMsg(Integer code) {
        UserSettingTypeEnum[] values = UserSettingTypeEnum.values();
        for (UserSettingTypeEnum value : values) {
            if (value.getCode() == code) {
                return value.getMsg();
            }
        }
        return null;
    }

    public static UserSettingTypeEnum getEnum(int code) {
        UserSettingTypeEnum[] values = UserSettingTypeEnum.values();
        for (UserSettingTypeEnum value : values) {
            if (value.getCode() == code) {
                return value;
            }
        }
        return null;
    }
}
