package com.ruoyi.xq.enums.vip;

import lombok.Getter;

import java.util.Arrays;

@Getter
public enum VipTypeEnum {
    ONE(1,"普通会员"),
    TWO(2,"黄金会员"),
    THREE(3,"钻石会员"),
    ;
    private final Integer code;
    private final String text;

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

    public static VipTypeEnum getByCode(Integer code){
        return Arrays.stream(VipTypeEnum.values()).filter(i -> i.getCode().equals(code)).findFirst().orElse(null);
    }
}
