package com.cf.imes.module.system.util.locale;

import com.cf.imes.module.system.controller.admin.dict.vo.data.DictDataSimpleRespVO;

import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 字典数据标签国际化缓存工具类
 *
 * @author Gqr
 * @since 2025/11/12 13:38
 */
public class DictDataI18nCacheUtils {
    private DictDataI18nCacheUtils() {
    }

    private static final Map<String, List<DictDataSimpleRespVO>> CACHE = new ConcurrentHashMap<>();

    /**
     * 获取缓存
     */
    public static Map<String, List<DictDataSimpleRespVO>> getCache() {
        return Collections.unmodifiableMap(CACHE);
    }

    /**
     * 缓存
     * @param map
     */
    public static void putCache(Map<String, List<DictDataSimpleRespVO>> map) {
        CACHE.putAll(map);
    }

    /**
     * 清除缓存
     */
    public static void clearCache() {
        CACHE.clear();
    }
}
