From fe63fd580c5b65fa398dfe1fdf44466b26c6aadd Mon Sep 17 00:00:00 2001
From: liusuyi <1951119284@qq.com>
Date: Sat, 22 Mar 2025 13:38:30 +0800
Subject: [PATCH] 优化

---
 ard-work/src/main/java/com/ard/tianyu/service/impl/TyServiceImpl.java |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/ard-work/src/main/java/com/ard/tianyu/service/impl/TyServiceImpl.java b/ard-work/src/main/java/com/ard/tianyu/service/impl/TyServiceImpl.java
index 33a4756..cef7380 100644
--- a/ard-work/src/main/java/com/ard/tianyu/service/impl/TyServiceImpl.java
+++ b/ard-work/src/main/java/com/ard/tianyu/service/impl/TyServiceImpl.java
@@ -34,7 +34,7 @@
 import com.ard.tianyu.domain.dto.signal.SignalInfo;
 import com.ard.tianyu.domain.dto.state.UavState;
 import com.ard.tianyu.domain.dto.telemetry.TelemetryData;
-import com.ard.tianyu.component.netty.TyNettyTcpClient;
+import com.ard.tianyu.component.netty.NettyTcpClient;
 import com.ard.tianyu.component.netty.command.control.AbsAngleControlCmd;
 import com.ard.tianyu.component.netty.command.control.AngleControlCmd;
 import com.ard.tianyu.component.netty.command.control.SpeedControlCmd;
@@ -48,7 +48,6 @@
 import com.ard.tianyu.component.netty.protobuf.TelemetryDataPB;
 import com.ard.tianyu.service.ITyService;
 import com.ard.tianyu.domain.message.UavControlType;
-import com.ard.vtdu.service.IMediaService;
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelFuture;
 import lombok.extern.slf4j.Slf4j;
@@ -76,8 +75,6 @@
     @Resource
     private TyConfiguration tyConfiguration;
 
-    @Resource
-    private IMediaService mediaService;
 
     /**
      * 获取天宇token信息
@@ -98,8 +95,8 @@
     public List<BoxInfoReceiver> getBoxList() {
         //请求云盒列表
         try {
-            TyHttpCommonReceiver<List<BoxInfoReceiver>> boxListReveiver = tyClient.getBoxList();
-            return boxListReveiver.getContent();
+            TyHttpCommonReceiver<List<BoxInfoReceiver>> boxListReceiver = tyClient.getBoxList();
+            return boxListReceiver.getContent();
         } catch (Exception e) {
             log.error("获取云盒列表失败:{}", e.getMessage());
             return new ArrayList<>();
@@ -632,8 +629,8 @@
                 break;
             case 0x02:
                 // 处理注册消息
-                HeartbeatReplyCmd heartbeatReplyCmd = (HeartbeatReplyCmd) tyCommand;
-                //logPrint("心跳消息", heartbeatReplyCmd.getTimestamp());
+                 HeartbeatReplyCmd heartbeatReplyCmd = (HeartbeatReplyCmd) tyCommand;
+                 logPrint("心跳消息", heartbeatReplyCmd.getTimestamp());
                 break;
             case 0x03:
                 // 处理订阅消息
@@ -830,7 +827,7 @@
      */
     private void sendMessage(String key, BaseCmd msg) {
         try {
-            ChannelFuture future = TyNettyTcpClient.channels.get(key).getChannelFuture();
+            ChannelFuture future = NettyTcpClient.channels.get(key).getChannelFuture();
             Channel channel = future.channel();
             if (channel.isActive()) {
                 InetSocketAddress ipSocket = (InetSocketAddress) channel.remoteAddress();

--
Gitblit v1.9.3