zoukankan      html  css  js  c++  java
  • SpringBoot:错误Missing URI template variable '币种ID' for method parameter of type int

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

  • 相关阅读:
    numpy 加速 以及 ipython
    sublime 插件
    doc文件转txt
    xls文件转化txt
    jmlr论文下载
    R 画地图
    shell并行处理
    Idea 配置
    beta函数分布图
    winEdt 使用
  • 原文地址:https://www.cnblogs.com/ivy-xu/p/12957347.html
Copyright © 2011-2022 走看看