From bb508127e9454e8b39ac7d431765b6de0ac74c35 Mon Sep 17 00:00:00 2001
From: liusuyi <1951119284@qq.com>
Date: Sat, 06 Sep 2025 15:39:02 +0800
Subject: [PATCH] 优化
---
ard-work/src/main/java/com/ard/tianyu/service/impl/TyServiceImpl.java | 17 +++++++----------
1 files changed, 7 insertions(+), 10 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..86dd640 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:
// 处理订阅消息
@@ -799,7 +796,7 @@
//公共日志打印
private void logPrint(String message, Object obj) {
- log.warn("收到{}回复{}", message, obj);
+ log.debug("收到{}回复{}", message, obj);
}
//公共日志打印
@@ -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