首页 > 编程语言 > 详细

SpringBoot:错误Missing URI template variable '币种ID' for method parameter of type int

时间:2020-05-25 16:10:55      阅读:94      评论:0      收藏:0      [点我收藏+]

调试接口时候,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。

SpringBoot:错误Missing URI template variable '币种ID' for method parameter of type int

原文:https://www.cnblogs.com/ivy-xu/p/12957347.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!