支持国标移动位置订阅,收到新位置发送redis消息;支持通道redis消息拉起第三方推流;云台控制添加ControlPriority字段;处理sql的bug
This commit is contained in:
@@ -29,7 +29,7 @@ public class ApiAccessFilter extends OncePerRequestFilter {
|
||||
private final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
@Autowired
|
||||
private UserSetup userSetup;
|
||||
private UserSetting userSetting;
|
||||
|
||||
@Autowired
|
||||
private ILogService logService;
|
||||
@@ -48,7 +48,7 @@ public class ApiAccessFilter extends OncePerRequestFilter {
|
||||
|
||||
filterChain.doFilter(servletRequest, servletResponse);
|
||||
|
||||
if (uriName != null && userSetup.getLogInDatebase()) {
|
||||
if (uriName != null && userSetting.getLogInDatebase()) {
|
||||
|
||||
LogDto logDto = new LogDto();
|
||||
logDto.setName(uriName);
|
||||
|
||||
@@ -7,6 +7,7 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
|
||||
@@ -45,12 +46,12 @@ public class DynamicTask {
|
||||
* 延时任务
|
||||
* @param key 任务ID
|
||||
* @param task 任务
|
||||
* @param delay 延时 /秒
|
||||
* @param delay 延时 /毫秒
|
||||
* @return
|
||||
*/
|
||||
public String startDelay(String key, Runnable task, int delay) {
|
||||
stop(key);
|
||||
Date starTime = new Date(System.currentTimeMillis() + delay * 1000);
|
||||
Date starTime = new Date(System.currentTimeMillis() + delay);
|
||||
// scheduleWithFixedDelay 必须等待上一个任务结束才开始计时period, cycleForCatalog表示执行的间隔
|
||||
ScheduledFuture future = threadPoolTaskScheduler.schedule(task, starTime);
|
||||
futureMap.put(key, future);
|
||||
@@ -67,4 +68,8 @@ public class DynamicTask {
|
||||
return futureMap.get(key) != null;
|
||||
}
|
||||
|
||||
public Set<String> getAllKeys() {
|
||||
return futureMap.keySet();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ public class RedisConfig extends CachingConfigurerSupport {
|
||||
|
||||
RedisMessageListenerContainer container = new RedisMessageListenerContainer();
|
||||
container.setConnectionFactory(connectionFactory);
|
||||
container.addMessageListener(redisGPSMsgListener, new PatternTopic(VideoManagerConstants.WVP_MSG_GPS_PREFIX));
|
||||
container.addMessageListener(redisGPSMsgListener, new PatternTopic(VideoManagerConstants.VM_MSG_GPS));
|
||||
return container;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,25 +3,24 @@ package com.genersoft.iot.vmp.conf;
|
||||
import org.springframework.data.redis.connection.RedisConnection;
|
||||
import org.springframework.data.redis.listener.KeyExpirationEventMessageListener;
|
||||
import org.springframework.data.redis.listener.RedisMessageListenerContainer;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
public class RedisKeyExpirationEventMessageListener extends KeyExpirationEventMessageListener {
|
||||
|
||||
private UserSetup userSetup;
|
||||
private UserSetting userSetting;
|
||||
private RedisMessageListenerContainer listenerContainer;
|
||||
private String keyspaceNotificationsConfigParameter = "EA";
|
||||
|
||||
public RedisKeyExpirationEventMessageListener(RedisMessageListenerContainer listenerContainer, UserSetup userSetup) {
|
||||
public RedisKeyExpirationEventMessageListener(RedisMessageListenerContainer listenerContainer, UserSetting userSetting) {
|
||||
super(listenerContainer);
|
||||
this.listenerContainer = listenerContainer;
|
||||
this.userSetup = userSetup;
|
||||
this.userSetting = userSetting;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
if (!userSetup.getRedisConfig()) {
|
||||
if (!userSetting.getRedisConfig()) {
|
||||
// 配置springboot默认Config为空,即不让应用去修改redis的默认配置,因为Redis服务出于安全会禁用CONFIG命令给远程用户使用
|
||||
setKeyspaceNotificationsConfigParameter("");
|
||||
}else {
|
||||
|
||||
@@ -4,9 +4,8 @@ import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatformCatch;
|
||||
import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
|
||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
|
||||
import com.genersoft.iot.vmp.media.zlm.ZLMRTPServerFactory;
|
||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
|
||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.core.annotation.Order;
|
||||
@@ -22,7 +21,7 @@ import java.util.List;
|
||||
public class SipPlatformRunner implements CommandLineRunner {
|
||||
|
||||
@Autowired
|
||||
private IVideoManagerStorager storager;
|
||||
private IVideoManagerStorage storager;
|
||||
|
||||
@Autowired
|
||||
private IRedisCatchStorage redisCatchStorage;
|
||||
|
||||
@@ -6,10 +6,12 @@ import org.springframework.stereotype.Component;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 配置文件 user-settings 映射的配置信息
|
||||
*/
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "user-settings", ignoreInvalidFields = true)
|
||||
public class UserSetup {
|
||||
public class UserSetting {
|
||||
|
||||
private Boolean savePositionHistory = Boolean.FALSE;
|
||||
|
||||
@@ -19,6 +21,8 @@ public class UserSetup {
|
||||
|
||||
private Long playTimeout = 18000L;
|
||||
|
||||
private int platformPlayTimeout = 60000;
|
||||
|
||||
private Boolean interfaceAuthentication = Boolean.TRUE;
|
||||
|
||||
private Boolean recordPushLive = Boolean.TRUE;
|
||||
@@ -134,4 +138,12 @@ public class UserSetup {
|
||||
public void setRecordSip(Boolean recordSip) {
|
||||
this.recordSip = recordSip;
|
||||
}
|
||||
|
||||
public int getPlatformPlayTimeout() {
|
||||
return platformPlayTimeout;
|
||||
}
|
||||
|
||||
public void setPlatformPlayTimeout(int platformPlayTimeout) {
|
||||
this.platformPlayTimeout = platformPlayTimeout;
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.genersoft.iot.vmp.conf.runner;
|
||||
|
||||
import com.genersoft.iot.vmp.conf.UserSetup;
|
||||
import com.genersoft.iot.vmp.conf.UserSetting;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
||||
import com.genersoft.iot.vmp.service.IDeviceService;
|
||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
|
||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.core.annotation.Order;
|
||||
@@ -21,13 +21,13 @@ import java.util.List;
|
||||
public class SipDeviceRunner implements CommandLineRunner {
|
||||
|
||||
@Autowired
|
||||
private IVideoManagerStorager storager;
|
||||
private IVideoManagerStorage storager;
|
||||
|
||||
@Autowired
|
||||
private IRedisCatchStorage redisCatchStorage;
|
||||
|
||||
@Autowired
|
||||
private UserSetup userSetup;
|
||||
private UserSetting userSetting;
|
||||
|
||||
@Autowired
|
||||
private IDeviceService deviceService;
|
||||
@@ -44,6 +44,7 @@ public class SipDeviceRunner implements CommandLineRunner {
|
||||
if (device != null && device.getSubscribeCycleForCatalog() > 0) {
|
||||
// 查询在线设备那些开启了订阅,为设备开启定时的目录订阅
|
||||
deviceService.addCatalogSubscribe(device);
|
||||
deviceService.addMobilePositionSubscribe(device);
|
||||
}
|
||||
}
|
||||
// 重置cseq计数
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.genersoft.iot.vmp.conf.security;
|
||||
|
||||
import com.genersoft.iot.vmp.conf.UserSetup;
|
||||
import com.genersoft.iot.vmp.conf.UserSetting;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -29,7 +29,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
private final static Logger logger = LoggerFactory.getLogger(WebSecurityConfig.class);
|
||||
|
||||
@Autowired
|
||||
private UserSetup userSetup;
|
||||
private UserSetting userSetting;
|
||||
|
||||
@Autowired
|
||||
private DefaultUserDetailsServiceImpl userDetailsService;
|
||||
@@ -77,7 +77,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
@Override
|
||||
public void configure(WebSecurity web) {
|
||||
|
||||
if (!userSetup.isInterfaceAuthentication()) {
|
||||
if (!userSetting.isInterfaceAuthentication()) {
|
||||
web.ignoring().antMatchers("**");
|
||||
}else {
|
||||
// 可以直接访问的静态数据
|
||||
@@ -91,7 +91,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
.antMatchers("/swagger-resources/**")
|
||||
.antMatchers("/v3/api-docs/**")
|
||||
.antMatchers("/js/**");
|
||||
List<String> interfaceAuthenticationExcludes = userSetup.getInterfaceAuthenticationExcludes();
|
||||
List<String> interfaceAuthenticationExcludes = userSetting.getInterfaceAuthenticationExcludes();
|
||||
for (String interfaceAuthenticationExclude : interfaceAuthenticationExcludes) {
|
||||
if (interfaceAuthenticationExclude.split("/").length < 4 ) {
|
||||
logger.warn("{}不满足两级目录,已忽略", interfaceAuthenticationExclude);
|
||||
|
||||
Reference in New Issue
Block a user