解决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);

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

上一篇:Java spring boot 实现支付宝支付


下一篇:SpringBoot普通参数与基本注解(@PathVariable、@RequestHeader、@RequestParam、@RequestBody)