package com.seer.teach.common.enums;


/**
 * TV版本类别枚举
 *
 * 0 - 稳定版
 * 1 - 内测版
 *
 * @author Captain
 * @since 2025-09-13
 */
public enum TvVersionCategoryEnum {

    /**
     * 稳定版
     */
    STABLE(0, "稳定版"),

    /**
     * 内测版
     */
    BETA(1, "内测版");

    private final int code;
    private final String desc;

    TvVersionCategoryEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    /**
     * 根据code获取枚举
     */
    public static TvVersionCategoryEnum fromCode(int code) {
        for (TvVersionCategoryEnum value : values()) {
            if (value.code == code) {
                return value;
            }
        }
        throw new IllegalArgumentException("未知的版本类别code: " + code);
    }
}