package com.hzs.common.core.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 奖衔枚举
 */
@AllArgsConstructor
@Getter
public enum EAwards {

    /**
     * -1=海粉
     */
    SEA_FLOUR(0, -1, "海粉", 1),

    /**
     * 0=无
     */
    MEMBER(1, 0, "无", 0),
    /**
     * 黄宝
     */
    HEADER(2, 5, "一级", 0),
    /**
     * 绿宝
     */
    MANAGER(3, 10, "二级", 0),
    /**
     * 蓝宝
     */
    HIGH_MANAGER(4, 15, "三级", 0),
    /**
     * 钻石
     */
    SENIOR_MANAGER(5, 20, "四级", 0),
    /**
     * 黄钻
     */
    CHIEF(6, 25, "五级", 0),
    /**
     * 绿钻
     */
    HIGH_CHIEF(7, 30, "六级", 0),
    /**
     * 星耀蓝钻
     */
    SENIOR_CHIEF(8, 35, "七级", 0),
    /**
     * 王者红钻
     */
    CHAIRMAN(9, 40, "八级", 0),
    /**
     * 传奇紫钻
     */
    HONOR_CHAIRMAN(10, 45, "九级", 0),

    /**
     * 10
     */
    GLOBAL_CHAIRMAN(11, 50, "十级", 0),
    /**
     * 11
     */
    LEVEL_ELEVEN(12, 55, "十一级", 0),
    /**
     * 12
     */
    LEVEL_TWELVE(13, 60, "十二级", 0),
    /**
     * 13
     */
    LEVEL_THIRTEEN(14, 65, "十三级", 0),
    /**
     * 14
     */
    LEVEL_FOURTEEN(15, 70, "十四级", 0),
    /**
     * 15
     */
    LEVEL_FIFTEEN(16, 75, "十五级", 0),

    ;

    /**
     * 序号
     */
    private final int index;
    /**
     * 实际值
     */
    private final int value;

    /**
     * 显示标签
     */
    private final String label;
    /**
     * 是否启用（0=是,1=否） -- 来源EYesNo
     */
    private final int enable;

    /**
     * 根据枚举值获取等级枚举值（用于级差枚举值转换）
     *
     * @param value
     * @return
     */
    public static Integer getGradeValueByValue(int value) {
        if (EGrade.START_UP.getValue() == value) {
            return EAwards.MEMBER.getValue();
        } else if (EGrade.HAI_FAN.getValue() == value) {
            return EAwards.HEADER.getValue();
        } else if (EGrade.YOU_KE.getValue() == value) {
            return EAwards.MANAGER.getValue();
        } else if (EGrade.MAKER.getValue() == value) {
            return EAwards.HIGH_MANAGER.getValue();
        } else if (EGrade.VIP.getValue() == value) {
            return EAwards.SENIOR_MANAGER.getValue();
        } else if (EGrade.S_VIP.getValue() == value) {
            return EAwards.CHIEF.getValue();
        }
        return 0;
    }


}
