@PathVariable
@PathVariable是spring3.0的一个新功能:接收请求路径中占位符的值
@PutMapping(value = "/users/{userId}/unLock") void unLock(@PathVariable("userId") String id, @RequestBody UnblockEvent unblockEvent) throws Exception { userService.apply(unblockEvent); }
id就是路径的userId值