package com.ruoyi.cai.enums;

import lombok.Getter;

@Getter
public enum ForbidTypeEnum {
    USER(1,"封用户"),
    UUID(2,"封设备"),
    IMEI(3,"封IMEI"),
    MAC(4,"封MAC"),
    IP(5,"封IP"),
    ;
    private final Integer code;
    private final String text;

    ForbidTypeEnum(Integer code, String text) {
        this.code = code;
        this.text = text;
    }

    public static ForbidTypeEnum getByCode(Integer code){
        ForbidTypeEnum[] values = ForbidTypeEnum.values();
        for (ForbidTypeEnum value : values) {
            if(value.getCode().equals(code)){
                return value;
            }
        }
        return null;
    }
}

