方法如下:
@RequestMapping(value = "/findIndividualExam/{personInfoId}", method = RequestMethod.GET)
public ResultDto findIndividualExam(@PathVariable String personInfoId){
return healthExamService.findIndividualExam(personInfoId);
}
拦截器中的代码如下:
Map<String, String> pathVars = (Map<String, String>) request.getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE);
得到的结果如下:
{personInfoId=bd8c1c25d3d84210ad77bafc56ed2177}