报错代码:

@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注解也可以

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐