您需要通过变量名或属性来区分这两个ID
value
从
@PathVariable
,比如:
@GetMapping("http://api.example.com/device-management/managed-devices/{idManagedDevice}/scripts/{idScript}"
public ResponseEntity<?> clone (HttpServletRequest request,
@PathVariable long idManagedDevice,
@PathVariable long idScript,
) {
..
}
或:
@GetMapping("http://api.example.com/device-management/managed-devices/{id}/scripts/{idScript}"
public ResponseEntity<?> clone (HttpServletRequest request,
@PathVariable(value="id") long idOfManagedDevice,
@PathVariable(value="idScript") long idOfScript,
) {
..
}