转:待确定:https://segmentfault.com/q/1010000009207313
可以指定多个匹配路径
@RequestMapping(value = {"/get/{userId}", "/get/{id}/{userId}"}, method = RequestMethod.GET)
然后设置参数非必须
@PathVariable(required = false) String id
请求参数写法:
@RequestParam(value = "id", required = false, defaultValue = "0")