错误:
{
"timestamp": "2022-11-01T10:34:27.891+0000",
"status": 500,
"error": "Internal Server Error",
"message": "[400] during [POST] to [http://iwater-d-s/device/exception/getDeviceExceptionsByAreaIdPage] [DeviceExceptionFeign#getDeviceExceptionsByAreaIdPage(Map)]: [{\"timestamp\":\"2022-11-01T10:34:27.888+0000\",\"status\":400,\"error\":\"Bad Request\",\"message\":\"JSON parse error: Illegal character ((CTRL-CHAR, code 31)): only regular white space (\\\\r, \\\\n, \\\\t) is allowe... (511 bytes)]",
"path": "/data/area/findAreaExceptionList"
}
原因:
params = {LinkedHashMap@15894} size = 5
"limit" -> "500"
"page" -> "1"
"exception" -> "0"
"areaIdByUserId" -> {ArrayList@18916} size = 109
"companyId" -> {Long@19258} 12
@PostMapping("/exception/getDeviceExceptionsByAreaIdPage")
PageResult<AreaDeviceExceptionCountDTO> getDeviceExceptionsByAreaIdPage(@RequestBody Map<String, Object> params);
@ApiOperation(value = "分页查询小区异常列表")
@PostMapping("/exception/getDeviceExceptionsByAreaIdPage")
public PageResult getDeviceExceptionsByAreaIdPage(@RequestBody Map<String,Object> params) {
//List<Long> areaIdList = JsonUtil.toList(areaIds);
return deviceExceptionService.getDeviceExceptionsByAreaIdPage(params);
}
解决:
@GetMapping("/exception/getDeviceExceptionsByAreaIdPage")
PageResult<AreaDeviceExceptionCountDTO> getDeviceExceptionsByAreaIdPage(@RequestBody Map<String, Object> params);
@ApiOperation(value = "分页查询小区异常列表")
@GetMapping("/exception/getDeviceExceptionsByAreaIdPage")
public PageResult getDeviceExceptionsByAreaIdPage(@RequestParam Map<String,Object> params) {
//List<Long> areaIdList = JsonUtil.toList(areaIds);
return deviceExceptionService.getDeviceExceptionsByAreaIdPage(params);
}