| | |
| | | @Override |
| | | public <T extends BaseResponseInnerFrame<T>> WrapResponseCommonFrame<T> sendRRPC(String deviceName, IRequestFrame iRequestFrame, Class<T> clz) { |
| | | CommonFrame commonFrame = sendRRPC(deviceName, iRequestFrame); |
| | | if (commonFrame == null) { |
| | | throw new BusinessException("rrpc请求失败"); |
| | | } |
| | | WrapResponseCommonFrame<T> responseCommonFrame = new WrapResponseCommonFrame<>(); |
| | | BeanUtils.copyProperties(commonFrame, responseCommonFrame); |
| | | try { |
| | | responseCommonFrame.setResponseTransform(clz.newInstance().transformFrame(responseCommonFrame.getPayload())); |
| | | responseCommonFrame.setResponseInnerFrame(clz.newInstance().transformFrame(responseCommonFrame.getPayload())); |
| | | } catch (InstantiationException | IllegalAccessException e) { |
| | | throw new BusinessException(String.format("找不到%s的构造函数", clz.getName())); |
| | | } |