【发布时间】:2018-09-18 10:02:24
【问题描述】:
我想将我的 springboot 项目从 1.5.1 迁移到 2.0.1。
但是当我在 RestController 中返回模型时 Instant 格式不同。
返回对象:
public class Message {
private Instant instant;
}
在 1.5.1 中:
{
"instant": {
"epochSecond": 1537263091,
"nano": 557000000
}
}
在 2.0.1 中:
{
"instant": "2018-09-18T09:46:02.646Z"
}
我怎样才能得到这个{ “立即的”: { “epochSecond”:1537263091, “纳米”:557000000 } } 当我使用 2.0.1 时?
【问题讨论】:
标签: java spring-boot jackson gson