作用:可以通过url占位符中的参数,绑定到处理器方法的参数中

@GetMapping("/{id}")
    public Shop getShop(@PathVariable("id") int id){
       Shop shop = shopService.findShop(id);
       return shop;
    }

 

posted on 2019-05-08 12:42  <meng>  阅读(117)  评论(0编辑  收藏  举报