首页 > 其他分享 >jackson解析LocalDateTime报错解决

jackson解析LocalDateTime报错解决

时间:2022-10-16 12:36:00浏览次数:68  
标签:JsonFormat jackson private 报错 LocalDateTime class

在字段上添加注释

class Data {
        private String status;

        @JsonDeserialize(using = LocalDateTimeDeserializer.class)
        @JsonSerialize(using = LocalDateTimeSerializer.class)
        @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime timestamp;

        private String type;

        private Double value;
    }

标签:JsonFormat,jackson,private,报错,LocalDateTime,class
From: https://www.cnblogs.com/xl4ng/p/16795953.html

相关文章