| | |
| | | |
| | | 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; |
| | | |
| | |
| | | |
| | | /** |
| | | * 获取天宇token信息 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AccessTokenReceiver getAccessToken() { |
| | | return tyConfiguration.getAccessToken(); |
| | | } |
| | | |
| | | /** |
| | | * 获取云盒列表 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | |
| | | 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(); |
| | | } |
| | | } |