调用接口出错,一般是时间转换问题。
引入依赖
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.12.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.12.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.12.0</version>
</dependency>
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime departTime;
// 下单时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime orderTime;
相应实体类加上注解
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")