Buggy code:
@ RestController @ RequestMapping ( { "${api.web}" , "${api.service}" } ) public class DutyCarerRestContorller extends GeroBaseController { private static Logger logger = Logger . getLogger ( DutyCarerRestContorller . class ) ; @ Autowired IDutyCarerService dutyCarerService ; @ Autowired IStaffDataService staffDataService ; @ RequestMapping ( value = "//gero//{gid}//elder//{eid}//duty_carer" , method = RequestMethod . GET , produces = MediaTypes . JSON_UTF_8 ) public Object getElderDutyCarer ( HttpServletRequest request , @ PathVariable ( "gid" ) int geroId , @ PathVariable ( "eid" ) int elderId , @ RequestParam ( value = "date" , required = false ) String date ) { } @ RequestMapping ( value = "//gero//{gid}//area//{aid}//duty_carer" , method = RequestMethod . GET , produces = MediaTypes . JSON_UTF_8 ) <START_BUG> public Object getAreaDutyCarer ( HttpServletRequest request , @ PathVariable ( "aid" ) <END_BUG> int geroId , @ PathVariable ( "aid" ) int areaId , @ RequestParam ( value = "date" , required = false ) String date ) { checkApi ( request ) ; checkGero ( geroId ) ; if ( ( date != null ) && ( ! ( ParamValidator . isDate ( date ) ) ) ) { String otherMessage = ( ( "date<seq2seq4repair_space>不符合日期格式:" + "[date=" ) + date ) + "]" ; String message = ErrorConstants . format ( DUTY_CARER_AREA_GET_PARAM_INVALID , otherMessage ) ; DutyCarerRestContorller . logger . error ( message ) ; throw new com . sjtu . icare . common . web . rest . RestException ( HttpStatus . BAD_REQUEST , message ) ; } try { if ( date == null ) { Date today = new Date ( ) ; date = DateUtils . formatDate ( DateUtils . getDateStart ( today ) ) ; } if ( date == null ) { Date thatDay = ParamUtils . convertStringToDate ( date ) ; date = DateUtils . formatDate ( DateUtils . getDateEnd ( thatDay ) ) ; } BasicReturnedJson basicReturnedJson = new BasicReturnedJson ( ) ; GeroAreaEntity queryGeroAreaEntity = new GeroAreaEntity ( ) ; queryGeroAreaEntity . setId ( areaId ) ; List < StaffEntity > dutyCarers = dutyCarerService . getDutyCarerByAreaIdAndDate ( queryGeroAreaEntity , date ) ; for ( StaffEntity staffEntity : dutyCarers ) { Map < String , Object > resultMap = new HashMap < String , Object > ( ) ; resultMap . put ( "id" , staffEntity . getId ( ) ) ; User user = staffDataService . getUserEntityOfStaff ( staffEntity ) ; resultMap . put ( "gero_id" , user . getGeroId ( ) ) ; resultMap . put ( "name" , user . getName ( ) ) ; resultMap . put ( "phone" , user . getPhoneNo ( ) ) ; resultMap . put ( "gender" , user . getGender ( ) ) ; resultMap . put ( "photo_url" , user . getPhotoUrl ( ) ) ; resultMap . put ( "work_date" , date ) ; basicReturnedJson . addEntity ( resultMap ) ; } return basicReturnedJson . getMap ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; String otherMessage = ( "[" + ( e . getMessage ( ) ) ) + "]" ; String message = ErrorConstants . format ( DUTY_CARER_ELDER_GET_SERVICE_FAILED , otherMessage ) ; DutyCarerRestContorller . logger . error ( message ) ; throw new com . sjtu . icare . common . web . rest . RestException ( HttpStatus . INTERNAL_SERVER_ERROR , message ) ; } } }

Fix:
public Object getAreaDutyCarer ( HttpServletRequest request , @ PathVariable ( "gid" )