幕布斯6054654
抽取个接口interface CommonService{ Page execute(Page page,String userInfoId,Map<String,String> params);}然后抽取共用的方法UIPageResponse getResponse(UIPage page,Map<String,String> params,CommonService service){ String userInfoId = LoginInfoManage.getAdminUser().getUserInfoId(); ... try{ _page = service.execute(page,userInfoId,params); }catch(Exception e){ e.printStackTrace(); } ... return uiPageResponse;}最后调用 return getResponse(page,params,new CommonService(){ Page execute(Page page,String userInfoId,Map<String,String> params){ return servcusTomerService.getFridend(_page,userInfoId,params); } })