解决后端需要接收Date类型参数,前端传过来的是字符串的问题。

在pojo中对特定的date类型属性加了以下配置
@DateTimeFormat来控制入参,@JsonFormat来控制出参

    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date payTime;

参考教程

Spring Boot jackson(Date类型入参、格式化,以及如何处理null)

相关文章:

  • 2021-11-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-09
  • 2022-02-08
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-14
  • 2022-12-23
  • 2021-10-12
  • 2022-12-23
  • 2022-01-01
相关资源
相似解决方案