package com.hzs.common.core.enums;

import com.hzs.common.core.constant.MemberFrameworkConstants;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 等级设置
 */
@AllArgsConstructor
@Getter
public enum EGrade {

    /**
     * -3=虚拟
     */
    VIRTUALLY(-3, 0, "虚拟", 1, MemberFrameworkConstants.xuni),
    /**
     * 1=待激活 死点 撤单
     */
    DEAD_POINT(-1, 0, "待激活", 1, MemberFrameworkConstants.toBeActivated),
    /**
     * 2=已注销 退单
     */
    LOGGED_OUT(-2, 0, "已注销", 1, MemberFrameworkConstants.LOG_OFF),

    /**
     * 会员
     */
    MEMBER(2, 30, "V1", 0, MemberFrameworkConstants.Hi_Pink),

    ;

    /**
     * 序号
     */
    private final int index;
    /**
     * 实际值
     */
    private final int value;
    /**
     * 显示标签
     */
    private final String label;
    /**
     * 是否启用（0=是,1=否） -- 来源EYesNo
     */
    private final int enable;
    /**
     * 头像地址
     */
    private final String imageUrl;

    public static EGrade getGrade(int value) {
        for (EGrade eGrade : EGrade.values()) {
            if (value == eGrade.value) {
                return eGrade;
            }
        }
        return null;
    }

}
