From af5555eb845dbbae6f7a33b14e268cef95c8677c Mon Sep 17 00:00:00 2001 From: fuqingji <51312040@qq.com> Date: Sat, 2 Apr 2022 16:52:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/FeignLocalDateTimeDecoder.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/main/java/com/chinaunicom/mall/ebtp/project/config/FeignLocalDateTimeDecoder.java diff --git a/src/main/java/com/chinaunicom/mall/ebtp/project/config/FeignLocalDateTimeDecoder.java b/src/main/java/com/chinaunicom/mall/ebtp/project/config/FeignLocalDateTimeDecoder.java new file mode 100644 index 0000000..72a8f7b --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/project/config/FeignLocalDateTimeDecoder.java @@ -0,0 +1,18 @@ +package com.chinaunicom.mall.ebtp.project.config; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import com.fasterxml.jackson.module.paramnames.ParameterNamesModule; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class FeignLocalDateTimeDecoder { + + @Bean(name = "mapperObject") + public ObjectMapper getObjectMapper() { + return new ObjectMapper().registerModule(new ParameterNamesModule()).registerModule(new Jdk8Module()) + .registerModule(new JavaTimeModule()); + } +}