@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "id", required = true, paramType = "body", dataType = "Integer")
})
@ApiOperation(value = "权限管理-删除", notes = "权限管理-删除")
@PostMapping("/remove")
public Response<Void> remove(@RequestBody Integer id) {
milepostLeaderService.remove(milepostLeaderDto.getId());
return new Response<Void>().success();
}
前端传:
{
"id": 5000
}
会出现错误:
{
"timestamp": "2021-12-10 10:02:16",
"status": 400,
"error": "Bad Request",
"message": "JSON parse error: Cannot deserialize instance of `java.lang.Integer` out of START_OBJECT token; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `java.lang.Integer` out of START_OBJECT token\n at [Source: (PushbackInputStream); line: 1, column: 1]",
"path": "/XXX/XXX/XXX/remove"
}
这个问题现在也不清楚原因,如果有人知道请指点,多谢~