From 7f9d813634b584abc6e076bf777f6064eaede3d2 Mon Sep 17 00:00:00 2001
From: liusuyi <1951119284@qq.com>
Date: Tue, 22 Oct 2024 10:28:47 +0800
Subject: [PATCH] 增加:获取直播地址|获取飞行历史|获取任务照片
---
ard-work/src/main/java/com/ard/tianyu/service/impl/TyServiceImpl.java | 51 +++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 47 insertions(+), 4 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 572bf5e..8fbd088 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
@@ -2,9 +2,9 @@
import com.ard.tianyu.config.TyConfiguration;
import com.ard.tianyu.http.TyClient;
-import com.ard.tianyu.model.receiver.AccessTokenReceiver;
-import com.ard.tianyu.model.receiver.BoxReceiver;
-import com.ard.tianyu.model.receiver.TyHttpCommonReceiver;
+import com.ard.tianyu.model.dto.BoxHistoryDTO;
+import com.ard.tianyu.model.dto.BoxPhotosDTO;
+import com.ard.tianyu.model.receiver.*;
import com.ard.tianyu.service.ITyService;
import org.springframework.stereotype.Service;
@@ -26,16 +26,59 @@
@Resource
private TyConfiguration tyConfiguration;
-
+ /**
+ * 获取天宇token信息
+ *
+ * @return
+ */
@Override
public AccessTokenReceiver getAccessToken() {
return tyConfiguration.getAccessToken();
}
+ /**
+ * 获取云盒列表
+ *
+ * @return
+ */
@Override
public List<BoxReceiver> getBoxList() {
//请求云盒列表
TyHttpCommonReceiver<List<BoxReceiver>> boxListReveiver = tyClient.getBoxList(tyConfiguration.getAccessToken().convertFromDTO());
return boxListReveiver.getContent();
}
+
+ /**
+ * 获取直播地址
+ *
+ * @return
+ */
+ @Override
+ public PullStreamUrlReceiver getBoxLiveUrl(String boxSn) {
+
+ TyHttpCommonReceiver<PullStreamUrlReceiver> boxLiveUrl = tyClient.getBoxLiveUrl(boxSn, tyConfiguration.getAccessToken().convertFromDTO());
+ return boxLiveUrl.getContent();
+ }
+
+ /**
+ * 获取飞行历史
+ *
+ * @return
+ */
+ @Override
+ public List<BoxHistoryReceiver> getBoxHistory(BoxHistoryDTO boxHistoryDTO) {
+ TyHttpCommonReceiver<List<BoxHistoryReceiver>> boxHistory = tyClient.getBoxHistory(boxHistoryDTO, tyConfiguration.getAccessToken().convertFromDTO());
+ return boxHistory.getContent();
+ }
+
+ /**
+ * 获取盒子图片
+ *
+ * @return
+ */
+ @Override
+ public List<BoxPhotosReceiver> getBoxPhotos(BoxPhotosDTO boxPhotosDTO) {
+ TyHttpCommonReceiver<List<BoxPhotosReceiver>> boxPhotos = tyClient.getBoxPhotos(boxPhotosDTO, tyConfiguration.getAccessToken().convertFromDTO());
+ return boxPhotos.getContent();
+ }
}
--
Gitblit v1.9.3