报错信息
Failed to convert property value of type 'java.lang.String' to required type
'java.util.Date' for property 'applicationtime'; nested exception is
org.springframework.core.convert.ConversionFailedException: Failed to convert
from type [java.lang.String] to type [java.util.Date] for value
'2020-10-18 21:59:49'; nested exception is java.lang.IllegalArgumentException
问题描述:接口传的时间参数,接收时没有进行格式转换,导致数据转换失败
解决方案:在实体类添加@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
public class aaa{
/**
* 申请时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date applicationtime;
}