package com.samsung.config;

import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.concurrent.ConcurrentMapCacheManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

import java.util.Arrays;

@Configuration
@EnableCaching
/*@Profile({"local"})*/ //prod 도 로칼과 동일한 설정으로 
public class CacheConfig {
    @Bean
    public CacheManager cacheManager() {
        ConcurrentMapCacheManager cacheManager = new ConcurrentMapCacheManager();
        cacheManager.setCacheNames(Arrays.asList("message-all", "message", "menu-all", "menu-label-all", "api-user", "api-user-menu", "page-all-by-menu-auth", "menu-full-path-all", "page-full-path-all", "api-full-path-all"));
        return cacheManager;
    }
}