package com.seer.teach.teacher.common.utils;

import com.seer.teach.teacher.common.dto.SubjectTag;

import java.util.*;

/**
 *
 * <p>
 *
 * </p >
 *
 * @author Captain
 * @since 2025-09-22 14:20
 */
public class SubjectTagUtils {

    private static final Map<String, SubjectTag> TAG_MAP = new HashMap<>();

    static {
        TAG_MAP.put("语文", new SubjectTag("文学达人", "#9B59B6"));
        TAG_MAP.put("数学", new SubjectTag("数学天才", "#3498DB"));
        TAG_MAP.put("英语", new SubjectTag("英语人", "#F39C12"));
        TAG_MAP.put("品德与生活", new SubjectTag("德育先锋", "#1ABC9C"));
        TAG_MAP.put("科学", new SubjectTag("科学小子", "#2980B9"));
        TAG_MAP.put("历史", new SubjectTag("历史通", "#8E6E53"));
        TAG_MAP.put("地理", new SubjectTag("地理通", "#D35400"));
        TAG_MAP.put("生物", new SubjectTag("生物家", "#27AE60"));
        TAG_MAP.put("政治", new SubjectTag("政治星", "#E74C3C"));
        TAG_MAP.put("物理", new SubjectTag("物理大师", "#2ECC71"));
        TAG_MAP.put("化学", new SubjectTag("化学家", "#E91E63"));
        TAG_MAP.put("信息技术", new SubjectTag("技术控", "#34495E"));
        TAG_MAP.put("课外拓展", new SubjectTag("拓展能手", "#F1C40F"));
        // 特殊情况
        TAG_MAP.put("全能", new SubjectTag("全能王", "#16A085"));
        TAG_MAP.put("潜力", new SubjectTag("潜力无限", "#7F8C8D"));
        TAG_MAP.put("未知", new SubjectTag("未知领域", "#95A5A6"));
        TAG_MAP.put("无数据", new SubjectTag("待探索", "#BDC3C7"));
    }

    /**
     * 获取所有 SubjectTag 的列表（不可修改）
     * @return List<SubjectTag>
     */
    public static List<SubjectTag> getAllTags() {
        return Collections.unmodifiableList(new ArrayList<>(TAG_MAP.values()));
    }

    /**
     * 获取所有标签映射（不可修改）
     */
    public static Map<String, SubjectTag> getSubjectTagMap() {
        return Collections.unmodifiableMap(TAG_MAP);
    }

    /**
     * 根据科目名称获取对应的潜能标签
     * @param subject 科目名称
     * @return SubjectTag，如果不存在返回 null
     */
    public static SubjectTag getTagBySubject(String subject) {
        return TAG_MAP.get(subject);
    }



}