调试接口时候,Missing URI template variable '币种ID' for method parameter of type int。

1     @ApiOperation(value = "销毁金额")
2     @PostMapping("/destroy/{currency_id}")
3     public Result destroyMoney(@PathVariable(value="币种ID") int currency_id) {
4         return fundsService.destroyMoney(currency_id);
5     }
6         

后来发现,不能在@PathVariable有value和name,下面这样就行:

1     @ApiOperation(value = "销毁金额")
2     @PostMapping("/destroy/{currency_id}")
3     public Result destroyMoney(@PathVariable("currency_id") int currency_id) {
4         return fundsService.destroyMoney(currency_id);
5     }

如果需要对参数说明,可以@ApiParam。

相关文章:

  • 2022-12-23
  • 2021-12-16
  • 2022-12-23
  • 2022-12-23
  • 2021-12-21
  • 2022-12-23
  • 2021-08-01
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-18
  • 2022-12-23
  • 2021-12-17
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案