From ca8eff0443856eba96ab930e6c5cd26695509c46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=9E=AC=EC=9B=90?= Date: Sun, 4 Aug 2024 14:55:36 +0900 Subject: [PATCH] =?UTF-8?q?Feat:=20LocalDateTime=20=EC=97=AD=EC=A7=81?= =?UTF-8?q?=EB=A0=AC=ED=99=94=20=EC=B6=94=EA=B0=80=20(#32)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dnd/runus/presentation/config/ObjectMapperConfig.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/dnd/runus/presentation/config/ObjectMapperConfig.java b/src/main/java/com/dnd/runus/presentation/config/ObjectMapperConfig.java index 8ce62a2d..c3c8f9a0 100644 --- a/src/main/java/com/dnd/runus/presentation/config/ObjectMapperConfig.java +++ b/src/main/java/com/dnd/runus/presentation/config/ObjectMapperConfig.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.module.SimpleModule; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; import com.fasterxml.jackson.datatype.jsr310.ser.*; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -38,10 +39,9 @@ ObjectMapper objectMapper() { InstantSerializer.INSTANCE, false, false, - dateTimeFormatter.withZone(SERVER_TIMEZONE_ID)) {}); - + dateTimeFormatter.withZone(SERVER_TIMEZONE_ID)) {}) + .addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(dateTimeFormatter)); objectMapper.registerModule(dateTimeModule); - return objectMapper; } }