Required request body is missing: 问题解决(亲测有效)
·
报错代码:
@ApiOperation("查询相关项目")
@GetMapping(value = "/project")
public AjaxResult getProjectInfo(@RequestBody WxProjectJudge wxProjectJudge)
{
List<WxProjectJudge> projectJudgeList= wxOrderRootService.getProjectJudge(wxProjectJudge);
return AjaxResult.success(projectJudgeList);
}
报错信息:
{
"code": 500,
"msg": "Required request body is missing: public com.ruoyi.common.core.domain....",
"success": false,
"total": 0
}
解决方式:
因为GetMapping 不支持@RequestBody,所以去掉@RequestBody注解就可以了
@ApiOperation("查询相关项目")
@GetMapping(value = "/project")
public AjaxResult getProjectInfo(WxProjectJudge wxProjectJudge)
{
List<WxProjectJudge> projectJudgeList= wxOrderRootService.getProjectJudge(wxProjectJudge);
return AjaxResult.success(projectJudgeList);
}
如果是需要json对象传输,改为post请求,使用@PostMapping注解也可以
更多推荐
已为社区贡献1条内容
所有评论(0)