可以使用@RequestBody
@PostMapping("/add")
public Result add(@RequestBody LogisticsDemand demand){
if(demand.getRefreshTime()==null){
demand.setRefreshTime(new Date());
}
int result = logisticsDemandService.insertdemand(demand,demand.getOrders());
if(result>0){
return Result.success("保存成功!");
}else{
return Result.error(501,"保存失败!");
}
}
时间格式的处理
@JsonFormat( pattern="yyyy-MM-dd HH:mm:ss")
private Date timeLimit;
参考:
https://blog.csdn.net/hqbootstrap1/article/details/81407645
https://blog.csdn.net/qq906627950/article/details/79503801