Cannot deserialize value of type `java.util.Date` from String “2021-04-26T16--这个问题

Cannot deserialize value of type java.util.Date from String "2021-04-26T16–这个问题

前端: beginTime: {
type: ‘string’, title: ‘起始时间’,format: ‘date-time’,
/ui: {
widget: ‘date’,
format: ‘yyyy-MM-dd HH:mm:ss’
} as SFDateWidgetSchema,
/
default: masdateToString(new Date(),true).replace( " “,“T”)+”+08:00"
},
后台: @BusinessLog(title = “新建请假申请”, businessType = BusinessType.INSERT)
@PostMapping(value = “/leave”)
public Result addSave(@RequestBody @Validated LeaveTask leaveTask) {
。。。。。
/**
* 起始时间
*/
LeaveTask.java数据类
@Excel(name = “起始时间”)
@ApiModelProperty(“起始时间”)
@JsonFormat(pattern=“yyyy-MM-dd’T’HH:mm:ss”)
//@DateTimeFormat(pattern = “yyyy-MM-dd HH:mm:ss”)
//@JsonFormat(pattern=“yyyy-MM-dd HH:mm:ss”,timezone=“GMT+8”)
private Date beginTime;
------
注意:数据类中,时间属性字段注解为@JsonFormat(pattern=“yyyy-MM-dd’T’HH:mm:ss”),可解决此bug

你可能感兴趣的:(java,spring)