依照https://stackoverflow.com/questions/23702041/failed-to-convert-property-value-of-type-java-lang-string-to-required-type-java文章所说:
加上如下注解:
@DateTimeFormat(pattern = "dd/MM/yyyy")
@Temporal(TemporalType.DATE)
具体代码如下
@Data public class WrongAnswerRecordParam extends BasicParam{ private Byte source; @NotNull(message="用户ID不能为空") private Long userId; private Long wrongAnswerId; private Long wrongAnswerTagId; private Long questionId; private Byte taskId; private Long groupId; private Integer subjectId; private String comment; private Long tagId; private Byte type; private Date updateTime; private Date createTime; @DateTimeFormat(pattern = "yyyy-MM-dd") private Date beginTime; @DateTimeFormat(pattern = "yyyy-MM-dd") private Date endTime; }
解决