解决springcloud 启动报 RequestParam.value() was empty on parameter 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);

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

猜你喜欢

转载自blog.csdn.net/saygood999/article/details/115070890