diff --git a/src/main/java/org/devcourse/resumeme/business/comment/service/CommentService.java b/src/main/java/org/devcourse/resumeme/business/comment/service/CommentService.java index 2aa69e46..04ce7a53 100644 --- a/src/main/java/org/devcourse/resumeme/business/comment/service/CommentService.java +++ b/src/main/java/org/devcourse/resumeme/business/comment/service/CommentService.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import lombok.RequiredArgsConstructor; import org.devcourse.resumeme.business.comment.domain.Comment; import org.devcourse.resumeme.business.comment.repository.CommentRepository; @@ -38,6 +39,8 @@ public Comment create(Comment comment, Long resumeId) { RestTemplate restTemplate = new RestTemplate(); Map> response = restTemplate.getForObject(new URI("http://localhost:8080/api/v1/resumes/" + resumeId), Map.class); ObjectMapper objectMapper = new ObjectMapper(); + objectMapper.registerModule(new JavaTimeModule()); + String json = objectMapper.writeValueAsString(response); snapshotRepository.save(new Snapshot(json, null, resumeId)); diff --git a/src/main/java/org/devcourse/resumeme/business/comment/service/CommentSnapEventListener.java b/src/main/java/org/devcourse/resumeme/business/comment/service/CommentSnapEventListener.java index 725a952f..ca8a01b1 100644 --- a/src/main/java/org/devcourse/resumeme/business/comment/service/CommentSnapEventListener.java +++ b/src/main/java/org/devcourse/resumeme/business/comment/service/CommentSnapEventListener.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import lombok.RequiredArgsConstructor; import org.devcourse.resumeme.business.comment.controller.dto.CommentWithReviewResponse; import org.devcourse.resumeme.business.resume.entity.Snapshot; @@ -29,6 +30,8 @@ public void onApplicationEvent(CommentSnapEvent event) { RestTemplate restTemplate = new RestTemplate(); CommentWithReviewResponse response = restTemplate.getForObject(new URI("http://localhost:8080/api/v1/events/" + eventId + "/resumes/" + resumeId + "/comments"), CommentWithReviewResponse.class); ObjectMapper objectMapper = new ObjectMapper(); + objectMapper.registerModule(new JavaTimeModule()); + String commentData = objectMapper.writeValueAsString(response); Optional snapshotOption = snapshotRepository.findByResumeId(resumeId); if (snapshotOption.isPresent()) {