My web service (Spring REST) receives the following POST request:
{
"id": "1",
"someKey" : "value",
"time":"2020-01-01 11:11:11+0000"
}
How can I map the time to a variable?
I use Hibernate for ORM, but the time is saved to the database as "null" when I use Date. I tried to use Timestamp, but got a parse error.
EDIT:
The controller looks like this:
@PostMapping("/endpoint")
public MyData handlePost(@RequestBody MyData mydata){
return repository.save(mydata);
}
question from:
https://stackoverflow.com/questions/65906239/how-to-map-timestamp-in-spring-rest 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…