mirror of
https://gitee.com/pan648540858/wvp-GB28181-pro.git
synced 2026-05-25 22:47:49 +08:00
Compare commits
4 Commits
1f34dbcf21
...
bfc063e4f7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bfc063e4f7 | ||
|
|
01b820c235 | ||
|
|
23e3173ed0 | ||
|
|
c19fae68a3 |
9
pom.xml
9
pom.xml
@ -242,12 +242,17 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba.fastjson2</groupId>
|
<groupId>com.alibaba.fastjson2</groupId>
|
||||||
<artifactId>fastjson2</artifactId>
|
<artifactId>fastjson2</artifactId>
|
||||||
<version>2.0.17</version>
|
<version>2.0.57</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba.fastjson2</groupId>
|
<groupId>com.alibaba.fastjson2</groupId>
|
||||||
<artifactId>fastjson2-extension</artifactId>
|
<artifactId>fastjson2-extension</artifactId>
|
||||||
<version>2.0.17</version>
|
<version>2.0.57</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.fastjson2</groupId>
|
||||||
|
<artifactId>fastjson2-extension-spring5</artifactId>
|
||||||
|
<version>2.0.57</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- okhttp -->
|
<!-- okhttp -->
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import org.springframework.data.redis.listener.RedisMessageListenerContainer;
|
|||||||
* @description:Redis中间件配置类,使用spring-data-redis集成,自动从application.yml中加载redis配置
|
* @description:Redis中间件配置类,使用spring-data-redis集成,自动从application.yml中加载redis配置
|
||||||
* @author: swwheihei
|
* @author: swwheihei
|
||||||
* @date: 2019年5月30日 上午10:58:25
|
* @date: 2019年5月30日 上午10:58:25
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
@Order(value=1)
|
@Order(value=1)
|
||||||
@ -38,7 +38,6 @@ public class RedisMsgListenConfig {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private RedisCloseStreamMsgListener redisCloseStreamMsgListener;
|
private RedisCloseStreamMsgListener redisCloseStreamMsgListener;
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RedisRpcConfig redisRpcConfig;
|
private RedisRpcConfig redisRpcConfig;
|
||||||
|
|
||||||
@ -49,7 +48,7 @@ public class RedisMsgListenConfig {
|
|||||||
/**
|
/**
|
||||||
* redis消息监听器容器 可以添加多个监听不同话题的redis监听器,只需要把消息监听器和相应的消息订阅处理器绑定,该消息监听器
|
* redis消息监听器容器 可以添加多个监听不同话题的redis监听器,只需要把消息监听器和相应的消息订阅处理器绑定,该消息监听器
|
||||||
* 通过反射技术调用消息订阅处理器的相关方法进行一些业务处理
|
* 通过反射技术调用消息订阅处理器的相关方法进行一些业务处理
|
||||||
*
|
*
|
||||||
* @param connectionFactory
|
* @param connectionFactory
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -44,6 +44,9 @@ public class CatalogEventLister implements ApplicationListener<CatalogEvent> {
|
|||||||
Map<String, CommonGBChannel> channelMap = new HashMap<>();
|
Map<String, CommonGBChannel> channelMap = new HashMap<>();
|
||||||
if (event.getPlatform() != null) {
|
if (event.getPlatform() != null) {
|
||||||
parentPlatform = event.getPlatform();
|
parentPlatform = event.getPlatform();
|
||||||
|
if (parentPlatform.getServerGBId() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
subscribe = subscribeHolder.getCatalogSubscribe(parentPlatform.getServerGBId());
|
subscribe = subscribeHolder.getCatalogSubscribe(parentPlatform.getServerGBId());
|
||||||
if (subscribe == null) {
|
if (subscribe == null) {
|
||||||
return;
|
return;
|
||||||
@ -156,4 +159,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.CommonGBChannel;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.Platform;
|
import com.genersoft.iot.vmp.gb28181.bean.Platform;
|
||||||
import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
|
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.IPlatformChannelService;
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IPlatformService;
|
import com.genersoft.iot.vmp.gb28181.service.IPlatformService;
|
||||||
import com.genersoft.iot.vmp.service.redisMsg.dto.RedisRpcController;
|
import com.genersoft.iot.vmp.service.redisMsg.dto.RedisRpcController;
|
||||||
@ -72,6 +71,7 @@ public class RedisRpcPlatformController extends RpcController {
|
|||||||
public RedisRpcResponse catalogEventPublish(RedisRpcRequest request) {
|
public RedisRpcResponse catalogEventPublish(RedisRpcRequest request) {
|
||||||
JSONObject jsonObject = JSONObject.parseObject(request.getParam().toString());
|
JSONObject jsonObject = JSONObject.parseObject(request.getParam().toString());
|
||||||
Platform platform = jsonObject.getObject("platform", Platform.class);
|
Platform platform = jsonObject.getObject("platform", Platform.class);
|
||||||
|
|
||||||
List<CommonGBChannel> channels = jsonObject.getJSONArray("channels").toJavaList(CommonGBChannel.class);
|
List<CommonGBChannel> channels = jsonObject.getJSONArray("channels").toJavaList(CommonGBChannel.class);
|
||||||
String type = jsonObject.getString("type");
|
String type = jsonObject.getString("type");
|
||||||
eventPublisher.catalogEventPublish(platform, channels, type, false);
|
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 io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.springframework.util.ObjectUtils;
|
import org.springframework.util.ObjectUtils;
|
||||||
|
|
||||||
@ -15,6 +16,7 @@ import org.springframework.util.ObjectUtils;
|
|||||||
@Data
|
@Data
|
||||||
@Schema(description = "推流信息")
|
@Schema(description = "推流信息")
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@NoArgsConstructor
|
||||||
public class StreamPush extends CommonGBChannel implements Comparable<StreamPush>{
|
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;
|
private Integer dataType = ChannelDataType.STREAM_PUSH.value;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(@NotNull StreamPush streamPushItem) {
|
public int compareTo(@NotNull StreamPush streamPushItem) {
|
||||||
return Long.valueOf(DateUtil.yyyy_MM_dd_HH_mm_ssToTimestamp(this.createTime)
|
return Long.valueOf(DateUtil.yyyy_MM_dd_HH_mm_ssToTimestamp(this.createTime)
|
||||||
|
|||||||
@ -39,7 +39,7 @@ public class StreamPushPlayServiceImpl implements IStreamPushPlayService {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserSetting userSetting;
|
private UserSetting userSetting;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private DynamicTask dynamicTask;
|
private DynamicTask dynamicTask;
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ public class StreamPushPlayServiceImpl implements IStreamPushPlayService {
|
|||||||
StreamPush streamPush = streamPushMapper.queryOne(id);
|
StreamPush streamPush = streamPushMapper.queryOne(id);
|
||||||
Assert.notNull(streamPush, "推流信息未找到");
|
Assert.notNull(streamPush, "推流信息未找到");
|
||||||
|
|
||||||
if (!userSetting.getServerId().equals(streamPush.getServerId())) {
|
if (streamPush.isPushing() && !userSetting.getServerId().equals(streamPush.getServerId())) {
|
||||||
redisRpcPlayService.playPush(id, callback);
|
redisRpcPlayService.playPush(id, callback);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,4 +2,4 @@ spring:
|
|||||||
application:
|
application:
|
||||||
name: wvp
|
name: wvp
|
||||||
profiles:
|
profiles:
|
||||||
active: dev
|
active: 273
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user