package com.iplatform.chat.config;
|
|
import com.iplatform.chat.ChatSessionCache;
|
import com.iplatform.chat.cache.LocalChatSessionCache;
|
import com.iplatform.chat.service.ChatDialogServiceImpl;
|
import com.iplatform.core.PlatformConfiguration;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Configuration;
|
|
@Configuration
|
@ConditionalOnProperty(prefix = "iplatform.cache", name = "redis-enabled", havingValue = "false", matchIfMissing = true)
|
public class LocalChatCacheConfig extends PlatformConfiguration {
|
|
@Bean
|
public ChatSessionCache chatSessionCache(ChatDialogServiceImpl chatDialogService){
|
LocalChatSessionCache cache = new LocalChatSessionCache();
|
cache.setChatDialogService(chatDialogService);
|
return cache;
|
}
|
}
|