로그에 메뉴코드 매핑하여 insert 하기
This commit is contained in:
@@ -5,11 +5,13 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
import java.time.Duration;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.cache.CacheManager;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.data.redis.cache.RedisCacheConfiguration;
|
||||
import org.springframework.data.redis.cache.RedisCacheManager;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
@@ -43,7 +45,8 @@ public class RedisConfig {
|
||||
}
|
||||
|
||||
/** Redis에서 사용할 공통 ObjectMapper */
|
||||
@Bean
|
||||
@Bean(name = "redisObjectMapper")
|
||||
@Primary
|
||||
public ObjectMapper redisObjectMapper() {
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
objectMapper.registerModule(new JavaTimeModule());
|
||||
@@ -56,7 +59,8 @@ public class RedisConfig {
|
||||
|
||||
/** 공통 Serializer (Template + Cache 둘 다 이거 사용) */
|
||||
@Bean
|
||||
public GenericJackson2JsonRedisSerializer redisSerializer(ObjectMapper redisObjectMapper) {
|
||||
public GenericJackson2JsonRedisSerializer redisSerializer(
|
||||
@Qualifier("redisObjectMapper") ObjectMapper redisObjectMapper) {
|
||||
return new GenericJackson2JsonRedisSerializer(redisObjectMapper);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user