package com.ruoyi.enums;

import com.ruoyi.common.utils.StringUtils;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum UserTypeEnum {
    Sys("00"), Card("01"), Agent("10"), Teacher("11"), Institution("12"), School("13"); // 用户类型（00系统01卡10代理11老师12机构）

    private final String val;

    public static Boolean isInstitution(String val){
        if (StringUtils.isEmpty(val)){
            return false;
        }
        return Institution.val.equalsIgnoreCase(val)||Institution.name().equalsIgnoreCase(val);
    }

    public static Boolean isTeacher(String val){
        if (StringUtils.isEmpty(val)){
            return false;
        }
        return Teacher.val.equalsIgnoreCase(val)||Teacher.name().equalsIgnoreCase(val);
    }

    public static Boolean isAgent(String val){
        if (StringUtils.isEmpty(val)){
            return false;
        }
        return Agent.val.equalsIgnoreCase(val)||Agent.name().equalsIgnoreCase(val);
    }

    public static Boolean isCard(String val){
        if (StringUtils.isEmpty(val)){
            return false;
        }
        return Card.val.equalsIgnoreCase(val)||Card.name().equalsIgnoreCase(val);
    }

    public static Boolean isSys(String val){
        if (StringUtils.isEmpty(val)){
            return false;
        }
        return Sys.val.equalsIgnoreCase(val)||Sys.name().equalsIgnoreCase(val);
    }

    public static Boolean isSchool(String val){
        if (StringUtils.isEmpty(val)){
            return false;
        }
        return School.val.equalsIgnoreCase(val) || School.name().equalsIgnoreCase(val);
    }

}
