入参:
“startTime”: “2024-01-16 00:00:00”, “endTime”: “2024-01-18 23:59:59”,
@GetMapping("/queryDisposalComplete")
JsonResult<Map<String, List<Dto>>> queryDisposalComplete(@RequestParam(value = "startTime", required = false) Date startTime,
@RequestParam(value = "endTime", required = false) Date endTime);
@GetMapping("/queryDisposalComplete")
public JsonResult<Map<String, List<Dto>>>> queryDisposalCompleter(@RequestParam(value = "startTime", required = false) Date startTime,
@RequestParam(value = "endTime", required = false) Date endTime) {
log.info("startTime:{},endTime:{}", JSONObject.toJSONString(startTime),JSONObject.toJSONString(endTime));
Map<String, List<Dto>> map = service.queryDisposalComplete(startTime,endTime);
return JsonResult.ok( map);
}
对应log
startTime:1705384800000,endTime:1705557599000
Unix 时间戳 转成 北京时间startTime: 2024-01-16 14:00:00 endTime:2024-01-18 13:59:59
时间多了,
@GetMapping("/queryDisposalComplete")
JsonResult<Map<String, List<Dto>>> queryDisposalComplete(@RequestParam(value = "startTime", required = false) String startTime,
@RequestParam(value = "endTime", required = false) String endTime);
然后根据String 类型转成Date即可。