package com.ruoyi.cai.enums;

import lombok.Getter;

/**
 * 1.封6小时 2.封1天  3.封3天  4.封7天  5.封一个月  6.封10年
 * <p>created on 2024/1/18 15:01</p>
 * @author 77
 */
@Getter
public enum ForbidTimeEnum {
    HOUSE_6(1,"封6小时"),
    DAY_1(2,"封1天"),
    DAY_3(3,"封3天"),
    DAY_7(4,"封7天"),
    MONTH_1(5,"封一个月"),
    YEAR_10(6,"封10年"),
    ;

    private final Integer code;
    private final String text;

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

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