@爱的旋转体
/**
* Support for Java date and time API.
*
* @return the corresponding Jackson module.
*/
@Bean
public JavaTimeModule javaTimeModule() {
JavaTimeModule javaTimeModule = new JavaTimeModule();
// Instant
javaTimeModule.addSerializer(Instant.class, new InstantSerializer());
javaTimeModule.addDeserializer(Instant.class, new InstantDeserializer());
return javaTimeModule;
}
SpringBoot对接收及返回Instant类型的处理一:处理post请求json中的Instant类型1.springboot中日期格式化配置: 以上配置只对Date类型的日期格式化有效,对LocalDateTime ,Ins...