Merge branch 'master' into dev/设备和平台使用不同的优化策略
This commit is contained in:
@@ -41,6 +41,9 @@ public class SubscribeHolder {
|
||||
}
|
||||
|
||||
public SubscribeInfo getCatalogSubscribe(String platformId) {
|
||||
if (platformId == null) {
|
||||
return null;
|
||||
}
|
||||
return catalogMap.get(platformId);
|
||||
}
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ public class DeviceChannelProvider {
|
||||
}
|
||||
sqlBuild.append(" )");
|
||||
}
|
||||
sqlBuild.append("ORDER BY device_id");
|
||||
sqlBuild.append(" ORDER BY device_id");
|
||||
return sqlBuild.toString();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
package com.genersoft.iot.vmp.gb28181.event.subscribe.catalog;
|
||||
|
||||
import com.genersoft.iot.vmp.conf.UserSetting;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.Platform;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.SubscribeHolder;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.SubscribeInfo;
|
||||
import com.genersoft.iot.vmp.gb28181.service.IPlatformChannelService;
|
||||
import com.genersoft.iot.vmp.gb28181.service.IPlatformService;
|
||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
|
||||
import com.genersoft.iot.vmp.service.redisMsg.IRedisRpcService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
@@ -17,7 +14,10 @@ import org.springframework.stereotype.Component;
|
||||
import javax.sip.InvalidArgumentException;
|
||||
import javax.sip.SipException;
|
||||
import java.text.ParseException;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* catalog事件
|
||||
@@ -156,4 +156,4 @@ public class CatalogEventLister implements ApplicationListener<CatalogEvent> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ import com.genersoft.iot.vmp.conf.redis.bean.RedisRpcResponse;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.Platform;
|
||||
import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
|
||||
import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent;
|
||||
import com.genersoft.iot.vmp.gb28181.service.IPlatformChannelService;
|
||||
import com.genersoft.iot.vmp.gb28181.service.IPlatformService;
|
||||
import com.genersoft.iot.vmp.service.redisMsg.dto.RedisRpcController;
|
||||
@@ -72,6 +71,7 @@ public class RedisRpcPlatformController extends RpcController {
|
||||
public RedisRpcResponse catalogEventPublish(RedisRpcRequest request) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(request.getParam().toString());
|
||||
Platform platform = jsonObject.getObject("platform", Platform.class);
|
||||
|
||||
List<CommonGBChannel> channels = jsonObject.getJSONArray("channels").toJavaList(CommonGBChannel.class);
|
||||
String type = jsonObject.getString("type");
|
||||
eventPublisher.catalogEventPublish(platform, channels, type, false);
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.genersoft.iot.vmp.utils.DateUtil;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
@@ -15,6 +16,7 @@ import org.springframework.util.ObjectUtils;
|
||||
@Data
|
||||
@Schema(description = "推流信息")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@NoArgsConstructor
|
||||
public class StreamPush extends CommonGBChannel implements Comparable<StreamPush>{
|
||||
|
||||
/**
|
||||
@@ -105,6 +107,7 @@ public class StreamPush extends CommonGBChannel implements Comparable<StreamPush
|
||||
|
||||
private Integer dataType = ChannelDataType.STREAM_PUSH.value;
|
||||
|
||||
|
||||
@Override
|
||||
public int compareTo(@NotNull StreamPush streamPushItem) {
|
||||
return Long.valueOf(DateUtil.yyyy_MM_dd_HH_mm_ssToTimestamp(this.createTime)
|
||||
|
||||
Reference in New Issue
Block a user