支持全局异常和统一返回结果,未完待续

This commit is contained in:
648540858
2022-08-21 22:22:34 +08:00
parent ecd14d6757
commit 5461b8ebf2
74 changed files with 844 additions and 15397 deletions

View File

@@ -60,16 +60,12 @@ public class RecordDataCatch {
// 处理录像数据, 返回给前端
String msgKey = DeferredResultHolder.CALLBACK_CMD_RECORDINFO + recordInfo.getDeviceId() + recordInfo.getSn();
WVPResult<RecordInfo> wvpResult = new WVPResult<>();
wvpResult.setCode(0);
wvpResult.setMsg("success");
// 对数据进行排序
Collections.sort(recordInfo.getRecordList());
wvpResult.setData(recordInfo);
RequestMessage msg = new RequestMessage();
msg.setKey(msgKey);
msg.setData(wvpResult);
msg.setData(recordInfo);
deferredResultHolder.invokeAllResult(msg);
data.remove(key);
}

View File

@@ -14,6 +14,7 @@ import com.genersoft.iot.vmp.utils.redis.RedisUtil;
import gov.nist.javax.sip.stack.SIPDialog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
/**
@@ -110,16 +111,16 @@ public class VideoStreamSessionManager {
public SsrcTransaction getSsrcTransaction(String deviceId, String channelId, String callId, String stream){
if (StringUtils.isEmpty(deviceId)) {
if (ObjectUtils.isEmpty(deviceId)) {
deviceId ="*";
}
if (StringUtils.isEmpty(channelId)) {
if (ObjectUtils.isEmpty(channelId)) {
channelId ="*";
}
if (StringUtils.isEmpty(callId)) {
if (ObjectUtils.isEmpty(callId)) {
callId ="*";
}
if (StringUtils.isEmpty(stream)) {
if (ObjectUtils.isEmpty(stream)) {
stream ="*";
}
String key = VideoManagerConstants.MEDIA_TRANSACTION_USED_PREFIX + userSetting.getServerId() + "_" + deviceId + "_" + channelId + "_" + callId+ "_" + stream;
@@ -131,16 +132,16 @@ public class VideoStreamSessionManager {
}
public List<SsrcTransaction> getSsrcTransactionForAll(String deviceId, String channelId, String callId, String stream){
if (StringUtils.isEmpty(deviceId)) {
if (ObjectUtils.isEmpty(deviceId)) {
deviceId ="*";
}
if (StringUtils.isEmpty(channelId)) {
if (ObjectUtils.isEmpty(channelId)) {
channelId ="*";
}
if (StringUtils.isEmpty(callId)) {
if (ObjectUtils.isEmpty(callId)) {
callId ="*";
}
if (StringUtils.isEmpty(stream)) {
if (ObjectUtils.isEmpty(stream)) {
stream ="*";
}
String key = VideoManagerConstants.MEDIA_TRANSACTION_USED_PREFIX + userSetting.getServerId() + "_" + deviceId + "_" + channelId + "_" + callId+ "_" + stream;