Commit 896a4e6c by zhouhaibao

[+]代码调整

1 parent 4cc95593
...@@ -27,13 +27,7 @@ public class ShutdownMachineRespHandler implements TcpHandler<ShutdownMachineRes ...@@ -27,13 +27,7 @@ public class ShutdownMachineRespHandler implements TcpHandler<ShutdownMachineRes
log.info("枪号:{}", data.getGunNumber()); log.info("枪号:{}", data.getGunNumber());
log.info("停止结果:{}", data.getShutdownResult()); log.info("停止结果:{}", data.getShutdownResult());
log.info("失败原因:{}", data.getFailureReason()); log.info("失败原因:{}", data.getFailureReason());
String key = ProxyHelper.setCallback(shutdownMachineResp, channel); ProxyHelper.setCallback(channel,shutdownMachineResp);
TcpCallback<TcpRsp> callback = ProxyHelper.getCallback(key);
if (Objects.nonNull(callback)) {
callback.callback(shutdownMachineResp);
} else {
log.info("callback为空===StartMachineRespHandler");
}
return null; return null;
} }
} }
...@@ -31,13 +31,7 @@ public class StartMachineRespHandler implements TcpHandler<StartMachineResp, Sta ...@@ -31,13 +31,7 @@ public class StartMachineRespHandler implements TcpHandler<StartMachineResp, Sta
data.setGunNumber((byte) 1); data.setGunNumber((byte) 1);
data.setFailureReason((byte) 0); data.setFailureReason((byte) 0);
resp.setData(data); resp.setData(data);
String key = ProxyHelper.setCallback(startMachineResp, channel); ProxyHelper.setCallback(channel,startMachineResp);
TcpCallback<TcpRsp> callback = ProxyHelper.getCallback(key);
if (Objects.nonNull(callback)) {
callback.callback(startMachineResp);
} else {
log.info("callback为空===StartMachineRespHandler");
}
return null; return null;
} }
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!