調試接口時候,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。
