package cn.reghao.tnb.content.api.constant;

import java.util.HashMap;
import java.util.Map;

/**
 * @author reghao
 * @date 2025-06-04 09:48:18
 */
public enum RcmdMode {
    VISITOR(1, "游客模式"),
    USER(2, "普通模式"),
    VIP(3, "VIP模式");

    private final Integer code;
    private final String desc;

    private static final Map<Integer, String> descMap = new HashMap<>();
    static {
        for (RcmdMode mode : RcmdMode.values()) {
            descMap.put(mode.code, mode.desc);
        }
    }

    RcmdMode(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getValue() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static String getDescByCode(int code) {
        return descMap.get(code);
    }
}
