1、错误信息:
Java 8 date/time type
java.time.Duration
not supported by default: add Module "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling
2、解决办法:
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.14.1'
3、加上下面两个注解:
// 解决报错 : Java 8 date/time type `java.time.Duration` not supported by default: add Module "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
@JsonSerialize(using = LocalDateTimeSerializer.class)
private LocalDateTime createTime;
标签:jackson,datatype,jsr310,time,com,fasterxml
From: https://www.cnblogs.com/qbbit/p/16994846.html