package top.continew.admin.business.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 平台子账号类型枚举
 *
 * @author jiay
 */
@Getter
@AllArgsConstructor
public enum PlantformBalanceEnum {

    CHAT(10000L, "大模型对话", 0), IMAGE(10001L, "图片大模型", 1), MEDIA(10002L, "视频大模型", 4),;

    /**
     * 模型平台类型
     */
    private final Long plantformId;
    /**
     * 描述
     */
    private final String desc;

    /**
     * 类型
     */
    private final Integer type;

    public static String convertDesc(Integer plantformId) {
        PlantformBalanceEnum[] values = PlantformBalanceEnum.values();
        for (PlantformBalanceEnum va : values) {
            if (va.getPlantformId().equals(plantformId)) {
                return va.getDesc();
            }
        }
        return "--";
    }

    public static Integer getType(Integer index) {
        PlantformBalanceEnum[] values = PlantformBalanceEnum.values();
        if (index != null && index >= 0 && index < values.length) {
            return values[index].getType();
        }
        return -1;

    }

    public static Long getPlantform(Integer index) {
        PlantformBalanceEnum[] values = PlantformBalanceEnum.values();
        if (index != null && index >= 0 && index < values.length) {
            return values[index].getPlantformId();
        }
        return -1L;
    }
}
