| | |
| | | } |
| | | |
| | | @Override |
| | | public ResponseResult payloadCommands(PayloadCommandsParam param, String bid) throws Exception { |
| | | param.getCmd().getClazz() |
| | | .getDeclaredConstructor(DronePayloadParam.class) |
| | | .newInstance(param.getData()) |
| | | .checkCondition(param.getSn()); |
| | | |
| | | ResponseResult result = ResponseResult.success(); |
| | | result.setTraceid(bid); |
| | | |
| | | Long timestamp = System.currentTimeMillis(); |
| | | |
| | | //拍照事件存redis |
| | | RedisOpsUtils.hashSet(RedisConst.COMMANDS_PREFIX + param.getSn() + RedisConst.DELIMITER + bid,bid,timestamp); |
| | | |
| | | ServiceReply serviceReply = messageSenderService.publishServicesTopic(param.getSn(), param.getCmd().getCmd(), param.getData(),bid,timestamp); |
| | | return ResponseResult.CODE_SUCCESS != serviceReply.getResult() ? |
| | | ResponseResult.error(serviceReply.getResult(), "错误码:" + serviceReply.getResult()) |
| | | : result; |
| | | } |
| | | |
| | | @Override |
| | | public ResponseResult requestsConfig(String sn, String method, RequestsParam param) { |
| | | ServiceReply serviceReply = messageSenderService.publishRequestsTopic(sn, method, param); |
| | | return ResponseResult.CODE_SUCCESS != serviceReply.getResult() ? |