|
@ -1,29 +1,27 @@ |
|
|
package org.dromara.sample.manage.service.impl; |
|
|
package org.dromara.sample.manage.service.impl; |
|
|
|
|
|
|
|
|
import cn.hutool.core.convert.Convert; |
|
|
import cn.hutool.json.JSONArray; |
|
|
|
|
|
import cn.hutool.json.JSONObject; |
|
|
|
|
|
import cn.hutool.json.JSONUtil; |
|
|
import jakarta.annotation.Resource; |
|
|
import jakarta.annotation.Resource; |
|
|
import org.apache.commons.collections.CollectionUtils; |
|
|
import org.apache.dubbo.config.annotation.DubboReference; |
|
|
import org.dromara.common.rocketmq.producer.MessageProducerUtil; |
|
|
|
|
|
import org.dromara.common.sdk.cloudapi.device.DeviceDomainEnum; |
|
|
import org.dromara.common.sdk.cloudapi.device.DeviceDomainEnum; |
|
|
import org.dromara.common.sdk.cloudapi.device.VideoId; |
|
|
import org.dromara.common.sdk.cloudapi.device.VideoId; |
|
|
import org.dromara.common.sdk.cloudapi.livestream.*; |
|
|
import org.dromara.common.sdk.cloudapi.livestream.*; |
|
|
import org.dromara.common.sdk.cloudapi.livestream.api.AbstractLivestreamService; |
|
|
import org.dromara.common.sdk.cloudapi.livestream.api.AbstractLivestreamService; |
|
|
import org.dromara.common.sdk.cloudapi.wayline.FlighttaskProgress; |
|
|
|
|
|
import org.dromara.common.sdk.common.HttpResultResponse; |
|
|
import org.dromara.common.sdk.common.HttpResultResponse; |
|
|
import org.dromara.common.sdk.common.SDKManager; |
|
|
import org.dromara.common.sdk.common.SDKManager; |
|
|
import org.dromara.common.sdk.mqtt.CommonTopicRequest; |
|
|
|
|
|
import org.dromara.common.sdk.mqtt.MqttGatewayPublish; |
|
|
import org.dromara.common.sdk.mqtt.MqttGatewayPublish; |
|
|
import org.dromara.common.sdk.mqtt.services.ServicesReplyData; |
|
|
import org.dromara.common.sdk.mqtt.services.ServicesReplyData; |
|
|
import org.dromara.common.sdk.mqtt.services.TopicServicesResponse; |
|
|
import org.dromara.common.sdk.mqtt.services.TopicServicesResponse; |
|
|
import org.dromara.sample.component.mqtt.model.EventsReceiver; |
|
|
|
|
|
import org.dromara.sample.feign.RemoteSystemFeign; |
|
|
import org.dromara.sample.feign.RemoteSystemFeign; |
|
|
import org.dromara.sample.manage.model.dto.*; |
|
|
import org.dromara.sample.manage.model.dto.*; |
|
|
import org.dromara.sample.manage.model.entity.DeviceEntity; |
|
|
|
|
|
import org.dromara.sample.manage.model.param.DeviceQueryParam; |
|
|
import org.dromara.sample.manage.model.param.DeviceQueryParam; |
|
|
import org.dromara.sample.manage.service.*; |
|
|
import org.dromara.sample.manage.service.*; |
|
|
import org.dromara.sample.wayline.model.dto.WaylineJobDTO; |
|
|
|
|
|
import org.dromara.sample.wayline.service.IWaylineJobService; |
|
|
import org.dromara.sample.wayline.service.IWaylineJobService; |
|
|
import org.dromara.sample.wayline.service.IWaylineRedisService; |
|
|
import org.dromara.sample.wayline.service.IWaylineRedisService; |
|
|
|
|
|
import org.dromara.system.api.RemoteDictService; |
|
|
|
|
|
import org.dromara.system.api.domain.vo.RemoteDictDataVo; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
@ -70,6 +68,9 @@ public class LiveStreamServiceImpl implements ILiveStreamService { |
|
|
@Resource |
|
|
@Resource |
|
|
private RemoteSystemFeign remoteSystemFeign; |
|
|
private RemoteSystemFeign remoteSystemFeign; |
|
|
|
|
|
|
|
|
|
|
|
@DubboReference |
|
|
|
|
|
private RemoteDictService remoteDictService; |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public List<CapacityDeviceDTO> getLiveCapacity(String workspaceId) { |
|
|
public List<CapacityDeviceDTO> getLiveCapacity(String workspaceId) { |
|
|
|
|
|
|
|
@ -290,9 +291,25 @@ public class LiveStreamServiceImpl implements ILiveStreamService { |
|
|
return agoraUrl.setSn(videoId.getDroneSn()); |
|
|
return agoraUrl.setSn(videoId.getDroneSn()); |
|
|
case RTMP: |
|
|
case RTMP: |
|
|
LivestreamRtmpUrl rtmpUrl = (LivestreamRtmpUrl) url.clone(); |
|
|
LivestreamRtmpUrl rtmpUrl = (LivestreamRtmpUrl) url.clone(); |
|
|
if(videoId.getDroneSn().equals("7CTXN2T00B07C5") || videoId.getDroneSn().equals("1581F6Q8X24CC00G02JB")){ |
|
|
//南通设备指定固定rtmpl路径 功能关闭
|
|
|
rtmpUrl.setUrl("rtmp://106.13.57.190/live/livesteam/"); |
|
|
/* List<RemoteDictDataVo> dictDataVoList = remoteDictService.selectDictDataByType("drone_stream_rtmp"); |
|
|
|
|
|
for (RemoteDictDataVo remoteDictDataVo : dictDataVoList) { |
|
|
|
|
|
if(JSONUtil.isTypeJSON(remoteDictDataVo.getRemark())){ |
|
|
|
|
|
JSONArray jsonArr = JSONUtil.parseArray(remoteDictDataVo.getRemark()); |
|
|
|
|
|
for (Object obj : jsonArr) { |
|
|
|
|
|
JSONObject entries = new JSONObject(obj); |
|
|
|
|
|
String droneSnStr = entries.getStr("droneSn"); |
|
|
|
|
|
String rtmpUrlStr = entries.getStr("rtmpUrl"); |
|
|
|
|
|
if(videoId.getDroneSn().equals(droneSnStr) ){ |
|
|
|
|
|
rtmpUrl.setUrl(rtmpUrlStr); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
|
|
// if(videoId.getDroneSn().equals("7CTXN2T00B07C5") || videoId.getDroneSn().equals("1581F6Q8X24CC00G02JB")){
|
|
|
|
|
|
// rtmpUrl.setUrl("rtmp://106.13.57.190/live/livesteam/");
|
|
|
|
|
|
// }
|
|
|
return rtmpUrl.setUrl(rtmpUrl.getUrl() + videoId.getDroneSn() + "-" + videoId.getPayloadIndex().toString()); |
|
|
return rtmpUrl.setUrl(rtmpUrl.getUrl() + videoId.getDroneSn() + "-" + videoId.getPayloadIndex().toString()); |
|
|
case GB28181: |
|
|
case GB28181: |
|
|
String random = String.valueOf(Math.abs(videoId.getDroneSn().hashCode()) % 1000); |
|
|
String random = String.valueOf(Math.abs(videoId.getDroneSn().hashCode()) % 1000); |
|
|