1     @GetMapping("/user/{id:\\d+}")  //使用正则指定Id为数字
2     public User getInfo(@PathVariable String id){
3         ...
4     }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-05
  • 2021-08-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-14
  • 2021-11-03
  • 2021-05-13
  • 2022-12-23
  • 2022-02-24
  • 2021-05-24
  • 2022-12-23
相关资源
相似解决方案