在model层中,类的日期属性上面添加如下注解:
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd hh:mm:ss")
Jackson Date格式化教程
© 著作权归作者所有