在Postman调试,日期类型写入不成功

Blade 未结 1 505
Macrath
Macrath 剑童 2022-02-16 17:19

一、该问题的重现步骤是什么?

1. image.png

2. image.png

3.image.png

使用代码生成,添加Format标注后仍提示Json转换失败


二、你期待的结果是什么?实际看到的又是什么?

成功Insert到数据库

三、你正在使用的是什么产品,什么版本?在什么操作系统上?

bladeX 云版本  win10

四、请提供详细的错误堆栈信息,这很重要。

{

    "code": 400,

    "success": false,

    "data": {},

    "msg": "JSON parse error: Cannot deserialize value of type `java.time.LocalDateTime` from String \"2020-06-27 16:00:00\": Failed to deserialize java.time.LocalDateTime: (java.time.format.DateTimeParseException) Text '2020-06-27 16:00:00' could not be parsed, unparsed text found at index 10; nested exception is com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `java.time.LocalDateTime` from String \"2020-06-27 16:00:00\": Failed to deserialize java.time.LocalDateTime: (java.time.format.DateTimeParseException) Text '2020-06-27 16:00:00' could not be parsed, unparsed text found at index 10\n at [Source: (PushbackInputStream); line: 1, column: 34] (through reference chain: org.springblade.device_archive.entity.FristContent[\"createTime\"])"

}



五、若有更多详细信息,请在下面提供。

点击重新加载Maven 就成功。。

1条回答
  • 换成Date类型

    0 讨论(0)
提交回复