当前位置: 代码迷 >> 综合 >> 解决springcloud 启动报 RequestParam.value() was empty on parameter 0
  详细解决方案

解决springcloud 启动报 RequestParam.value() was empty on parameter 0

热度:85   发布时间:2024-01-03 22:22:23.0

带有此类型的错误RequestParam.value() was empty on parameter 0

那说明你用feign远程调用参数写的不对咯

比如代码如下:

@ApiOperation(value = "查询当前登录用户的所有组织机构id(包括一级、二级。。。所有的机构id)", httpMethod = "GET")
@RequestMapping(value = "/getAllOrganizationId", method = RequestMethod.GET)
Result<List<Integer>> getAllOrganizationId(@RequestParam(required = false) Integer organizationId);

如果启动报上面的错误的话。你一定要在RequestParam中加入===> name="organizationId"

也就是说

@ApiOperation(value = "查询当前登录用户的所有组织机构id(包括一级、二级。。。所有的机构id)", httpMethod = "GET") @RequestMapping(value = "/getAllOrganizationId", method = RequestMethod.GET) Result<List<Integer>> getAllOrganizationId(@RequestParam(required = false,name="organizationId") Integer organizationId);

这样就可以完美解决此类问题。

  相关解决方案