mirror of
https://gitee.com/iteaj/iboot.git
synced 2026-09-01 15:26:10 +08:00
修改gb28181模块
This commit is contained in:
@@ -31,7 +31,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
* @author iteaj
|
||||
* @since 1.0
|
||||
*/
|
||||
@EnableAsync
|
||||
@EnableAsync(proxyTargetClass = true)
|
||||
@ImportAutoConfiguration({
|
||||
CaptchaAutoConfiguration.class, // 校验码配置
|
||||
FrameworkWebConfiguration.class // 框架Web容器配置
|
||||
|
||||
@@ -5,8 +5,12 @@ spring.datasource.password=@Ioter
|
||||
spring.datasource.driver-class-name=com.p6spy.engine.spy.P6SpyDriver
|
||||
spring.datasource.url=jdbc:p6spy:mysql://192.168.66.4:3306/iboot?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
|
||||
# redis \u76F8\u5173\u914D\u7F6E
|
||||
spring.redis.port=6379
|
||||
spring.redis.host=172.27.130.193
|
||||
spring.redis.password=
|
||||
spring.redis.database=0
|
||||
spring.redis.timeout=10000
|
||||
spring.redis.host=192.168.20.199
|
||||
|
||||
# \u6587\u4EF6\u4E0A\u4F20\u6839\u76EE\u5F55
|
||||
framework.web.upload.pattern=/file/**
|
||||
|
||||
@@ -5,6 +5,13 @@ spring.datasource.password=123456
|
||||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/iboot?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
|
||||
# redis \u76F8\u5173\u914D\u7F6E
|
||||
spring.redis.port=6379
|
||||
spring.redis.password=
|
||||
spring.redis.database=0
|
||||
spring.redis.timeout=10000
|
||||
spring.redis.host=127.0.0.1
|
||||
|
||||
# \u6587\u4EF6\u4E0A\u4F20\u6839\u76EE\u5F55
|
||||
framework.upload-location=/data/upload
|
||||
framework.upload-pattern=/file/**
|
||||
|
||||
@@ -5,6 +5,13 @@ spring.datasource.password=@Ioter
|
||||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.url=jdbc:mysql://192.168.66.4:3306/iboot?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
|
||||
# redis \u76F8\u5173\u914D\u7F6E
|
||||
spring.redis.port=6379
|
||||
spring.redis.password=
|
||||
spring.redis.database=0
|
||||
spring.redis.timeout=10000
|
||||
spring.redis.host=127.0.0.1
|
||||
|
||||
# \u6587\u4EF6\u4E0A\u4F20\u914D\u7F6E
|
||||
framework.upload-location=/data/upload
|
||||
framework.upload-pattern=/file/**
|
||||
|
||||
@@ -2,7 +2,7 @@ spring.application.name=BootstrapApplication
|
||||
# \u4F7F\u7528maven\u914D\u7F6E\u73AF\u5883\u53C2\u6570[dev,test,prod]
|
||||
spring.profiles.active=dev
|
||||
# \u53EF\u9009\u542F\u7528\u7684\u6A21\u5757\u503C[iot]
|
||||
spring.profiles.include=iot
|
||||
spring.profiles.include=iot,wvp
|
||||
# \u5141\u8BB8\u5FAA\u73AF\u5F15\u7528
|
||||
spring.main.allow-circular-references=true
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<optional>true</optional>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
</dependency>
|
||||
@@ -90,4 +91,16 @@
|
||||
<version>${excelpoi.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<includes>
|
||||
<include>*/**</include>
|
||||
</includes>
|
||||
<filtering>true</filtering>
|
||||
<directory>src/main/resources</directory>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
@@ -18,6 +18,11 @@ public class FrameworkProperties {
|
||||
*/
|
||||
private boolean cluster;
|
||||
|
||||
/**
|
||||
* 版本
|
||||
*/
|
||||
private String version;
|
||||
|
||||
/**
|
||||
* web环境配置
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
################## \u7CFB\u7EDF\u6846\u67B6\u914D\u7F6E ################
|
||||
spring.config.name=framework
|
||||
|
||||
#\u7CFB\u7EDF\u7248\u672C\u53F7
|
||||
framework.version=${@reversion@:2.1.0}
|
||||
############################# web\u4EE5\u53CAtoken\u76F8\u5173\u914D\u7F6E ##########################
|
||||
# \u662F\u5426\u542F\u7528\u64CD\u4F5C\u65E5\u5FD7\u8BB0\u5F55
|
||||
framework.web.logger=true
|
||||
@@ -15,5 +17,5 @@ framework.web.session.automatic-token=true
|
||||
|
||||
spring.autoconfigure.exclude[0]=cn.dev33.satoken.dao.SaTokenDaoRedisJackson
|
||||
|
||||
# \u6846\u67B6\u5305\u542Bmybatis\u548Cjdbc\u76F8\u5173\u914D\u7F6E
|
||||
spring.config.import=classpath:application-mybatis.properties,classpath:application-jdbc.properties
|
||||
# \u6846\u67B6\u5305\u542Bmybatis\u3001jdbc\u3001web\u76F8\u5173\u914D\u7F6E
|
||||
spring.config.import=classpath:application-web.properties,classpath:application-mybatis.properties,classpath:application-jdbc.properties
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
################## web\u914D\u7F6E ################
|
||||
spring.servlet.multipart.max-file-size=10MB
|
||||
spring.servlet.multipart.max-request-size=50MB
|
||||
|
||||
# \u8BBE\u7F6E\u63A5\u53E3\u8D85\u65F6\u65F6\u95F4
|
||||
spring.mvc.async.request-timeout=20000
|
||||
@@ -15,6 +15,11 @@
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>log4j-over-slf4j</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
@@ -28,24 +33,6 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mybatis.spring.boot</groupId>
|
||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||
<version>2.2.2</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.zaxxer</groupId>
|
||||
<artifactId>HikariCP</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- mysql数据库 -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>8.0.30</version>
|
||||
</dependency>
|
||||
|
||||
<!--在线文档 -->
|
||||
<dependency>
|
||||
@@ -54,12 +41,6 @@
|
||||
<version>1.6.10</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-springdoc-ui</artifactId>
|
||||
<version>3.0.3</version>
|
||||
</dependency>
|
||||
|
||||
<!--参数校验 -->
|
||||
<dependency>
|
||||
<groupId>javax.validation</groupId>
|
||||
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
package com.genersoft.iot.vmp;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.boot.web.servlet.ServletComponentScan;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
|
||||
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||
|
||||
@ComponentScan({"com.genersoft.iot.vmp"})
|
||||
@ServletComponentScan("com.genersoft.iot.vmp.conf")
|
||||
@MapperScan("com.genersoft.iot.vmp.storager.dao")
|
||||
@PropertySource("classpath:application-wvp.yml")
|
||||
public class GbSipAutoConfiguration {
|
||||
|
||||
// @Bean
|
||||
// public RedisTemplate<Object, Object> wvpRedisTemplate(RedisConnectionFactory connectionFactory) {
|
||||
//
|
||||
// RedisTemplate<Object, Object> redisTemplate = new RedisTemplate<>();
|
||||
// // 使用fastJson序列化
|
||||
// Jackson2JsonRedisSerializer jsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class);
|
||||
// // value值的序列化采用fastJsonRedisSerializer
|
||||
// redisTemplate.setValueSerializer(jsonRedisSerializer);
|
||||
// redisTemplate.setHashValueSerializer(jsonRedisSerializer);
|
||||
//
|
||||
// // key的序列化采用StringRedisSerializer
|
||||
// redisTemplate.setKeySerializer(new StringRedisSerializer());
|
||||
// redisTemplate.setHashKeySerializer(new StringRedisSerializer());
|
||||
// redisTemplate.setConnectionFactory(connectionFactory);
|
||||
// return redisTemplate;
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package com.genersoft.iot.vmp;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.web.servlet.ServletComponentScan;
|
||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
/**
|
||||
* 启动类
|
||||
*/
|
||||
@ServletComponentScan("com.genersoft.iot.vmp.conf")
|
||||
@SpringBootApplication
|
||||
@EnableScheduling
|
||||
public class VManageBootstrap extends SpringBootServletInitializer {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(VManageBootstrap.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
-28
@@ -1,28 +0,0 @@
|
||||
package com.genersoft.iot.vmp.conf.redis;
|
||||
|
||||
import com.alibaba.fastjson2.support.spring.data.redis.GenericFastJsonRedisSerializer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||
|
||||
@Configuration
|
||||
public class RedisTemplateConfig {
|
||||
|
||||
@Bean
|
||||
public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) {
|
||||
RedisTemplate<Object, Object> redisTemplate = new RedisTemplate<>();
|
||||
// 使用fastJson序列化
|
||||
GenericFastJsonRedisSerializer fastJsonRedisSerializer = new GenericFastJsonRedisSerializer();
|
||||
// value值的序列化采用fastJsonRedisSerializer
|
||||
redisTemplate.setValueSerializer(fastJsonRedisSerializer);
|
||||
redisTemplate.setHashValueSerializer(fastJsonRedisSerializer);
|
||||
|
||||
// key的序列化采用StringRedisSerializer
|
||||
redisTemplate.setKeySerializer(new StringRedisSerializer());
|
||||
redisTemplate.setHashKeySerializer(new StringRedisSerializer());
|
||||
redisTemplate.setConnectionFactory(redisConnectionFactory);
|
||||
return redisTemplate;
|
||||
}
|
||||
}
|
||||
+67
-72
@@ -1,56 +1,56 @@
|
||||
package com.genersoft.iot.vmp.gb28181.bean;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.iteaj.framework.Entity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import java.beans.Transient;
|
||||
|
||||
/**
|
||||
* 国标设备/平台
|
||||
* @author lin
|
||||
*/
|
||||
@TableName("wvp_device")
|
||||
@Schema(description = "国标设备/平台")
|
||||
public class Device implements Entity<Integer> {
|
||||
public class Device implements Entity<Long> {
|
||||
|
||||
private Integer id;
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 设备国标编号
|
||||
*/
|
||||
@Schema(description = "设备国标编号")
|
||||
private String deviceId;
|
||||
|
||||
/**
|
||||
* 设备名
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
|
||||
/**
|
||||
* 生产厂商
|
||||
*/
|
||||
@Schema(description = "生产厂商")
|
||||
private String manufacturer;
|
||||
|
||||
|
||||
/**
|
||||
* 型号
|
||||
*/
|
||||
@Schema(description = "型号")
|
||||
private String model;
|
||||
|
||||
|
||||
/**
|
||||
* 固件版本
|
||||
*/
|
||||
@Schema(description = "固件版本")
|
||||
private String firmware;
|
||||
|
||||
/**
|
||||
* 传输协议
|
||||
* UDP/TCP
|
||||
*/
|
||||
@Schema(description = "传输协议(UDP/TCP)")
|
||||
private String transport;
|
||||
|
||||
/**
|
||||
@@ -59,153 +59,146 @@ public class Device implements Entity<Integer> {
|
||||
* TCP-ACTIVE:tcp主动模式
|
||||
* TCP-PASSIVE:tcp被动模式
|
||||
*/
|
||||
@Schema(description = "数据流传输模式")
|
||||
private String streamMode;
|
||||
|
||||
/**
|
||||
* wan地址_ip
|
||||
*/
|
||||
@Schema(description = "IP")
|
||||
private String ip;
|
||||
|
||||
/**
|
||||
* wan地址_port
|
||||
*/
|
||||
@Schema(description = "端口")
|
||||
private int port;
|
||||
private Integer port;
|
||||
|
||||
/**
|
||||
* wan地址
|
||||
*/
|
||||
@Schema(description = "wan地址")
|
||||
private String hostAddress;
|
||||
|
||||
|
||||
/**
|
||||
* 在线
|
||||
* 是否在线,true为在线,false为离线
|
||||
*/
|
||||
@Schema(description = "是否在线,true为在线,false为离线")
|
||||
private boolean onLine;
|
||||
private Boolean onLine;
|
||||
|
||||
|
||||
/**
|
||||
* 注册时间
|
||||
*/
|
||||
@Schema(description = "注册时间")
|
||||
private String registerTime;
|
||||
|
||||
|
||||
/**
|
||||
* 心跳时间
|
||||
*/
|
||||
@Schema(description = "心跳时间")
|
||||
private String keepaliveTime;
|
||||
|
||||
|
||||
/**
|
||||
* 心跳间隔
|
||||
*/
|
||||
@Schema(description = "心跳间隔")
|
||||
private int keepaliveIntervalTime;
|
||||
private Integer keepaliveIntervalTime;
|
||||
|
||||
/**
|
||||
* 通道个数
|
||||
*/
|
||||
@Schema(description = "通道个数")
|
||||
private int channelCount;
|
||||
@TableField(exist = false)
|
||||
private Integer channelCount;
|
||||
|
||||
/**
|
||||
* 注册有效期
|
||||
*/
|
||||
@Schema(description = "注册有效期")
|
||||
private int expires;
|
||||
private Integer expires;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description = "更新时间")
|
||||
private String updateTime;
|
||||
|
||||
/**
|
||||
* 设备使用的媒体id, 默认为null
|
||||
*/
|
||||
@Schema(description = "设备使用的媒体id, 默认为null")
|
||||
private String mediaServerId;
|
||||
|
||||
/**
|
||||
* 字符集, 支持 UTF-8 与 GB2312
|
||||
*/
|
||||
@Schema(description = "符集, 支持 UTF-8 与 GB2312")
|
||||
private String charset ;
|
||||
|
||||
/**
|
||||
* 目录订阅周期,0为不订阅
|
||||
*/
|
||||
@Schema(description = "目录订阅周期,o为不订阅")
|
||||
private int subscribeCycleForCatalog;
|
||||
|
||||
/**
|
||||
* 移动设备位置订阅周期,0为不订阅
|
||||
*/
|
||||
@Schema(description = "移动设备位置订阅周期,0为不订阅")
|
||||
private int subscribeCycleForMobilePosition;
|
||||
|
||||
/**
|
||||
* 移动设备位置信息上报时间间隔,单位:秒,默认值5
|
||||
*/
|
||||
@Schema(description = "移动设备位置信息上报时间间隔,单位:秒,默认值5")
|
||||
private int mobilePositionSubmissionInterval = 5;
|
||||
|
||||
/**
|
||||
* 报警订阅周期,0为不订阅
|
||||
*/
|
||||
@Schema(description = "报警心跳时间订阅周期,0为不订阅")
|
||||
private int subscribeCycleForAlarm;
|
||||
|
||||
/**
|
||||
* 是否开启ssrc校验,默认关闭,开启可以防止串流
|
||||
*/
|
||||
@Schema(description = "是否开启ssrc校验,默认关闭,开启可以防止串流")
|
||||
private boolean ssrcCheck = false;
|
||||
private Boolean ssrcCheck = false;
|
||||
|
||||
/**
|
||||
* 地理坐标系, 目前支持 WGS84,GCJ02
|
||||
*/
|
||||
@Schema(description = "地理坐标系, 目前支持 WGS84,GCJ02")
|
||||
private String geoCoordSys;
|
||||
|
||||
@Schema(description = "密码")
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
@Schema(description = "收流IP")
|
||||
/**
|
||||
* 收流IP
|
||||
*/
|
||||
private String sdpIp;
|
||||
|
||||
@Schema(description = "SIP交互IP(设备访问平台的IP)")
|
||||
/**
|
||||
* SIP交互IP(设备访问平台的IP)
|
||||
*/
|
||||
private String localIp;
|
||||
|
||||
@Schema(description = "是否作为消息通道")
|
||||
private boolean asMessageChannel;
|
||||
/**
|
||||
* 是否作为消息通道
|
||||
*/
|
||||
private Boolean asMessageChannel;
|
||||
|
||||
/**
|
||||
* 设备注册的事务信息
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "设备注册的事务信息")
|
||||
private SipTransactionInfo sipTransactionInfo;
|
||||
|
||||
/*======================设备主子码流逻辑START=========================*/
|
||||
@Schema(description = "开启主子码流切换的开关(false-不开启,true-开启)")
|
||||
private boolean switchPrimarySubStream;
|
||||
/**
|
||||
* 开启主子码流切换的开关(false-不开启,true-开启)
|
||||
*/
|
||||
private Boolean switchPrimarySubStream;
|
||||
|
||||
@Override
|
||||
public Integer getId() {
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setId(Integer id) {
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@@ -261,6 +254,7 @@ public class Device implements Entity<Integer> {
|
||||
return streamMode;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Integer getStreamModeForParam() {
|
||||
if (streamMode == null) {
|
||||
return 0;
|
||||
@@ -287,11 +281,11 @@ public class Device implements Entity<Integer> {
|
||||
this.ip = ip;
|
||||
}
|
||||
|
||||
public int getPort() {
|
||||
public Integer getPort() {
|
||||
return port;
|
||||
}
|
||||
|
||||
public void setPort(int port) {
|
||||
public void setPort(Integer port) {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
@@ -303,19 +297,19 @@ public class Device implements Entity<Integer> {
|
||||
this.hostAddress = hostAddress;
|
||||
}
|
||||
|
||||
public boolean isOnLine() {
|
||||
public Boolean isOnLine() {
|
||||
return onLine;
|
||||
}
|
||||
|
||||
public void setOnLine(boolean onLine) {
|
||||
public void setOnLine(Boolean onLine) {
|
||||
this.onLine = onLine;
|
||||
}
|
||||
|
||||
public int getChannelCount() {
|
||||
public Integer getChannelCount() {
|
||||
return channelCount;
|
||||
}
|
||||
|
||||
public void setChannelCount(int channelCount) {
|
||||
public void setChannelCount(Integer channelCount) {
|
||||
this.channelCount = channelCount;
|
||||
}
|
||||
|
||||
@@ -335,11 +329,11 @@ public class Device implements Entity<Integer> {
|
||||
this.keepaliveTime = keepaliveTime;
|
||||
}
|
||||
|
||||
public int getExpires() {
|
||||
public Integer getExpires() {
|
||||
return expires;
|
||||
}
|
||||
|
||||
public void setExpires(int expires) {
|
||||
public void setExpires(Integer expires) {
|
||||
this.expires = expires;
|
||||
}
|
||||
|
||||
@@ -375,43 +369,43 @@ public class Device implements Entity<Integer> {
|
||||
this.charset = charset;
|
||||
}
|
||||
|
||||
public int getSubscribeCycleForCatalog() {
|
||||
public Integer getSubscribeCycleForCatalog() {
|
||||
return subscribeCycleForCatalog;
|
||||
}
|
||||
|
||||
public void setSubscribeCycleForCatalog(int subscribeCycleForCatalog) {
|
||||
public void setSubscribeCycleForCatalog(Integer subscribeCycleForCatalog) {
|
||||
this.subscribeCycleForCatalog = subscribeCycleForCatalog;
|
||||
}
|
||||
|
||||
public int getSubscribeCycleForMobilePosition() {
|
||||
public Integer getSubscribeCycleForMobilePosition() {
|
||||
return subscribeCycleForMobilePosition;
|
||||
}
|
||||
|
||||
public void setSubscribeCycleForMobilePosition(int subscribeCycleForMobilePosition) {
|
||||
public void setSubscribeCycleForMobilePosition(Integer subscribeCycleForMobilePosition) {
|
||||
this.subscribeCycleForMobilePosition = subscribeCycleForMobilePosition;
|
||||
}
|
||||
|
||||
public int getMobilePositionSubmissionInterval() {
|
||||
public Integer getMobilePositionSubmissionInterval() {
|
||||
return mobilePositionSubmissionInterval;
|
||||
}
|
||||
|
||||
public void setMobilePositionSubmissionInterval(int mobilePositionSubmissionInterval) {
|
||||
public void setMobilePositionSubmissionInterval(Integer mobilePositionSubmissionInterval) {
|
||||
this.mobilePositionSubmissionInterval = mobilePositionSubmissionInterval;
|
||||
}
|
||||
|
||||
public int getSubscribeCycleForAlarm() {
|
||||
public Integer getSubscribeCycleForAlarm() {
|
||||
return subscribeCycleForAlarm;
|
||||
}
|
||||
|
||||
public void setSubscribeCycleForAlarm(int subscribeCycleForAlarm) {
|
||||
public void setSubscribeCycleForAlarm(Integer subscribeCycleForAlarm) {
|
||||
this.subscribeCycleForAlarm = subscribeCycleForAlarm;
|
||||
}
|
||||
|
||||
public boolean isSsrcCheck() {
|
||||
public Boolean isSsrcCheck() {
|
||||
return ssrcCheck;
|
||||
}
|
||||
|
||||
public void setSsrcCheck(boolean ssrcCheck) {
|
||||
public void setSsrcCheck(Boolean ssrcCheck) {
|
||||
this.ssrcCheck = ssrcCheck;
|
||||
}
|
||||
|
||||
@@ -447,7 +441,7 @@ public class Device implements Entity<Integer> {
|
||||
this.localIp = localIp;
|
||||
}
|
||||
|
||||
public int getKeepaliveIntervalTime() {
|
||||
public Integer getKeepaliveIntervalTime() {
|
||||
return keepaliveIntervalTime;
|
||||
}
|
||||
|
||||
@@ -455,11 +449,11 @@ public class Device implements Entity<Integer> {
|
||||
this.keepaliveIntervalTime = keepaliveIntervalTime;
|
||||
}
|
||||
|
||||
public boolean isAsMessageChannel() {
|
||||
public Boolean isAsMessageChannel() {
|
||||
return asMessageChannel;
|
||||
}
|
||||
|
||||
public void setAsMessageChannel(boolean asMessageChannel) {
|
||||
public void setAsMessageChannel(Boolean asMessageChannel) {
|
||||
this.asMessageChannel = asMessageChannel;
|
||||
}
|
||||
|
||||
@@ -471,14 +465,15 @@ public class Device implements Entity<Integer> {
|
||||
this.sipTransactionInfo = sipTransactionInfo;
|
||||
}
|
||||
|
||||
public boolean isSwitchPrimarySubStream() {
|
||||
public Boolean isSwitchPrimarySubStream() {
|
||||
return switchPrimarySubStream;
|
||||
}
|
||||
|
||||
public void setSwitchPrimarySubStream(boolean switchPrimarySubStream) {
|
||||
public void setSwitchPrimarySubStream(Boolean switchPrimarySubStream) {
|
||||
this.switchPrimarySubStream = switchPrimarySubStream;
|
||||
}
|
||||
|
||||
|
||||
/*======================设备主子码流逻辑END=========================*/
|
||||
|
||||
|
||||
|
||||
+145
-168
@@ -1,168 +1,149 @@
|
||||
package com.genersoft.iot.vmp.gb28181.bean;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.iteaj.framework.Entity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@TableName("wvp_device_channel")
|
||||
@Schema(description = "通道信息")
|
||||
public class DeviceChannel implements Entity<Integer> {
|
||||
public class DeviceChannel implements Entity<Long> {
|
||||
|
||||
|
||||
/**
|
||||
* 数据库自增ID
|
||||
*/
|
||||
@Schema(description = "数据库自增ID")
|
||||
private Integer id;
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 通道国标编号
|
||||
*/
|
||||
@Schema(description = "通道国标编号")
|
||||
private String channelId;
|
||||
|
||||
/**
|
||||
* 设备国标编号
|
||||
*/
|
||||
@Schema(description = "设备国标编号")
|
||||
private String deviceId;
|
||||
|
||||
/**
|
||||
* 通道名
|
||||
*/
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 生产厂商
|
||||
*/
|
||||
@Schema(description = "生产厂商")
|
||||
private String manufacture;
|
||||
|
||||
/**
|
||||
* 型号
|
||||
*/
|
||||
@Schema(description = "型号")
|
||||
private String model;
|
||||
|
||||
/**
|
||||
* 设备归属
|
||||
*/
|
||||
@Schema(description = "设备归属")
|
||||
private String owner;
|
||||
|
||||
/**
|
||||
* 行政区域
|
||||
*/
|
||||
@Schema(description = "行政区域")
|
||||
private String civilCode;
|
||||
|
||||
/**
|
||||
* 警区
|
||||
*/
|
||||
@Schema(description = "警区")
|
||||
private String block;
|
||||
|
||||
/**
|
||||
* 安装地址
|
||||
*/
|
||||
@Schema(description = "安装地址")
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 是否有子设备 1有, 0没有
|
||||
*/
|
||||
@Schema(description = "是否有子设备 1有, 0没有")
|
||||
private int parental;
|
||||
private Integer parental;
|
||||
|
||||
/**
|
||||
* 父级id
|
||||
*/
|
||||
@Schema(description = "父级id")
|
||||
private String parentId;
|
||||
|
||||
/**
|
||||
* 信令安全模式 缺省为0; 0:不采用; 2: S/MIME签名方式; 3: S/ MIME加密签名同时采用方式; 4:数字摘要方式
|
||||
*/
|
||||
@Schema(description = "信令安全模式 缺省为0; 0:不采用; 2: S/MIME签名方式; 3: S/ MIME加密签名同时采用方式; 4:数字摘要方式")
|
||||
private int safetyWay;
|
||||
private Integer safetyWay;
|
||||
|
||||
/**
|
||||
* 注册方式 缺省为1;1:符合IETFRFC3261标准的认证注册模 式; 2:基于口令的双向认证注册模式; 3:基于数字证书的双向认证注册模式
|
||||
*/
|
||||
@Schema(description = "注册方式 缺省为1;1:符合IETFRFC3261标准的认证注册模 式; 2:基于口令的双向认证注册模式; 3:基于数字证书的双向认证注册模式")
|
||||
private int registerWay;
|
||||
private Integer registerWay;
|
||||
|
||||
/**
|
||||
* 证书序列号
|
||||
*/
|
||||
@Schema(description = "证书序列号")
|
||||
private String certNum;
|
||||
|
||||
/**
|
||||
* 证书有效标识 缺省为0;证书有效标识:0:无效1: 有效
|
||||
*/
|
||||
@Schema(description = "证书有效标识 缺省为0;证书有效标识:0:无效1: 有效")
|
||||
private int certifiable;
|
||||
private Integer certifiable;
|
||||
|
||||
/**
|
||||
* 证书无效原因码
|
||||
*/
|
||||
@Schema(description = "证书无效原因码")
|
||||
private int errCode;
|
||||
private Integer errCode;
|
||||
|
||||
/**
|
||||
* 证书终止有效期
|
||||
*/
|
||||
@Schema(description = "证书终止有效期")
|
||||
private String endTime;
|
||||
|
||||
/**
|
||||
* 保密属性 缺省为0; 0:不涉密, 1:涉密
|
||||
*/
|
||||
@Schema(description = "保密属性 缺省为0; 0:不涉密, 1:涉密")
|
||||
private String secrecy;
|
||||
|
||||
/**
|
||||
* IP地址
|
||||
*/
|
||||
@Schema(description = "IP地址")
|
||||
private String ipAddress;
|
||||
|
||||
/**
|
||||
* 端口号
|
||||
*/
|
||||
@Schema(description = "端口号")
|
||||
private int port;
|
||||
private Integer port;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@Schema(description = "密码")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 云台类型
|
||||
*/
|
||||
@Schema(description = "云台类型")
|
||||
private int PTZType;
|
||||
private Integer ptzType;
|
||||
|
||||
private Integer customPtzType;
|
||||
|
||||
/**
|
||||
* 云台类型描述字符串
|
||||
*/
|
||||
@Schema(description = "云台类型描述字符串")
|
||||
private String PTZTypeText;
|
||||
@TableField(exist = false)
|
||||
private String ptzTypeText;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间")
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Schema(description = "更新时间")
|
||||
private String updateTime;
|
||||
|
||||
/**
|
||||
@@ -174,92 +155,76 @@ public class DeviceChannel implements Entity<Integer> {
|
||||
* <Status>OFF</Status>
|
||||
* 遇到过NVR下的IPC下发信令可以推流, 但是 Status 响应 OFF
|
||||
*/
|
||||
@Schema(description = "在线/离线, 1在线,0离线")
|
||||
private boolean status;
|
||||
private Boolean status;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
@Schema(description = "经度")
|
||||
private double longitude;
|
||||
private Double longitude;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
@Schema(description = "纬度")
|
||||
private double latitude;
|
||||
private Double latitude;
|
||||
|
||||
/**
|
||||
* 经度 GCJ02
|
||||
* GCJ02坐标系经度
|
||||
*/
|
||||
@Schema(description = "GCJ02坐标系经度")
|
||||
private double longitudeGcj02;
|
||||
private Double longitudeGcj02;
|
||||
|
||||
/**
|
||||
* 纬度 GCJ02
|
||||
*/
|
||||
@Schema(description = "GCJ02坐标系纬度")
|
||||
private double latitudeGcj02;
|
||||
private Double latitudeGcj02;
|
||||
|
||||
/**
|
||||
* 经度 WGS84
|
||||
*/
|
||||
@Schema(description = "WGS84坐标系经度")
|
||||
private double longitudeWgs84;
|
||||
private Double longitudeWgs84;
|
||||
|
||||
/**
|
||||
* 纬度 WGS84
|
||||
*/
|
||||
@Schema(description = "WGS84坐标系纬度")
|
||||
private double latitudeWgs84;
|
||||
private Double latitudeWgs84;
|
||||
|
||||
/**
|
||||
* 子设备数
|
||||
*/
|
||||
@Schema(description = "子设备数")
|
||||
private int subCount;
|
||||
private Integer subCount;
|
||||
|
||||
/**
|
||||
* 流唯一编号,存在表示正在直播
|
||||
*/
|
||||
@Schema(description = "流唯一编号,存在表示正在直播")
|
||||
private String streamId;
|
||||
|
||||
/**
|
||||
* 是否含有音频
|
||||
*/
|
||||
@Schema(description = "是否含有音频")
|
||||
private boolean hasAudio;
|
||||
private Boolean hasAudio;
|
||||
|
||||
/**
|
||||
* 标记通道的类型,0->国标通道 1->直播流通道 2->业务分组/虚拟组织/行政区划
|
||||
*/
|
||||
@Schema(description = "标记通道的类型,0->国标通道 1->直播流通道 2->业务分组/虚拟组织/行政区划")
|
||||
private int channelType;
|
||||
@TableField(exist = false)
|
||||
private Integer channelType;
|
||||
|
||||
/**
|
||||
* 业务分组
|
||||
*/
|
||||
@Schema(description = "业务分组")
|
||||
private String businessGroupId;
|
||||
|
||||
/**
|
||||
* GPS的更新时间
|
||||
*/
|
||||
@Schema(description = "GPS的更新时间")
|
||||
private String gpsTime;
|
||||
|
||||
@Override
|
||||
public Integer getId() {
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@@ -271,23 +236,23 @@ public class DeviceChannel implements Entity<Integer> {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public void setPTZType(int PTZType) {
|
||||
this.PTZType = PTZType;
|
||||
switch (PTZType) {
|
||||
public void setPtzType(int ptzType) {
|
||||
this.ptzType = ptzType;
|
||||
switch (ptzType) {
|
||||
case 0:
|
||||
this.PTZTypeText = "未知";
|
||||
this.ptzTypeText = "未知";
|
||||
break;
|
||||
case 1:
|
||||
this.PTZTypeText = "球机";
|
||||
this.ptzTypeText = "球机";
|
||||
break;
|
||||
case 2:
|
||||
this.PTZTypeText = "半球";
|
||||
this.ptzTypeText = "半球";
|
||||
break;
|
||||
case 3:
|
||||
this.PTZTypeText = "固定枪机";
|
||||
this.ptzTypeText = "固定枪机";
|
||||
break;
|
||||
case 4:
|
||||
this.PTZTypeText = "遥控枪机";
|
||||
this.ptzTypeText = "遥控枪机";
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -356,11 +321,11 @@ public class DeviceChannel implements Entity<Integer> {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public int getParental() {
|
||||
public Integer getParental() {
|
||||
return parental;
|
||||
}
|
||||
|
||||
public void setParental(int parental) {
|
||||
public void setParental(Integer parental) {
|
||||
this.parental = parental;
|
||||
}
|
||||
|
||||
@@ -372,19 +337,19 @@ public class DeviceChannel implements Entity<Integer> {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public int getSafetyWay() {
|
||||
public Integer getSafetyWay() {
|
||||
return safetyWay;
|
||||
}
|
||||
|
||||
public void setSafetyWay(int safetyWay) {
|
||||
public void setSafetyWay(Integer safetyWay) {
|
||||
this.safetyWay = safetyWay;
|
||||
}
|
||||
|
||||
public int getRegisterWay() {
|
||||
public Integer getRegisterWay() {
|
||||
return registerWay;
|
||||
}
|
||||
|
||||
public void setRegisterWay(int registerWay) {
|
||||
public void setRegisterWay(Integer registerWay) {
|
||||
this.registerWay = registerWay;
|
||||
}
|
||||
|
||||
@@ -396,19 +361,19 @@ public class DeviceChannel implements Entity<Integer> {
|
||||
this.certNum = certNum;
|
||||
}
|
||||
|
||||
public int getCertifiable() {
|
||||
public Integer getCertifiable() {
|
||||
return certifiable;
|
||||
}
|
||||
|
||||
public void setCertifiable(int certifiable) {
|
||||
public void setCertifiable(Integer certifiable) {
|
||||
this.certifiable = certifiable;
|
||||
}
|
||||
|
||||
public int getErrCode() {
|
||||
public Integer getErrCode() {
|
||||
return errCode;
|
||||
}
|
||||
|
||||
public void setErrCode(int errCode) {
|
||||
public void setErrCode(Integer errCode) {
|
||||
this.errCode = errCode;
|
||||
}
|
||||
|
||||
@@ -436,11 +401,11 @@ public class DeviceChannel implements Entity<Integer> {
|
||||
this.ipAddress = ipAddress;
|
||||
}
|
||||
|
||||
public int getPort() {
|
||||
public Integer getPort() {
|
||||
return port;
|
||||
}
|
||||
|
||||
public void setPort(int port) {
|
||||
public void setPort(Integer port) {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
@@ -452,96 +417,28 @@ public class DeviceChannel implements Entity<Integer> {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public int getPTZType() {
|
||||
return PTZType;
|
||||
public Integer getPtzType() {
|
||||
return ptzType;
|
||||
}
|
||||
|
||||
public String getPTZTypeText() {
|
||||
return PTZTypeText;
|
||||
public void setPtzType(Integer ptzType) {
|
||||
this.ptzType = ptzType;
|
||||
}
|
||||
|
||||
public void setPTZTypeText(String PTZTypeText) {
|
||||
this.PTZTypeText = PTZTypeText;
|
||||
public Integer getCustomPtzType() {
|
||||
return customPtzType;
|
||||
}
|
||||
|
||||
public boolean isStatus() {
|
||||
return status;
|
||||
public void setCustomPtzType(Integer customPtzType) {
|
||||
this.customPtzType = customPtzType;
|
||||
}
|
||||
|
||||
public void setStatus(boolean status) {
|
||||
this.status = status;
|
||||
public String getPtzTypeText() {
|
||||
return ptzTypeText;
|
||||
}
|
||||
|
||||
public double getLongitude() {
|
||||
return longitude;
|
||||
}
|
||||
|
||||
public void setLongitude(double longitude) {
|
||||
this.longitude = longitude;
|
||||
}
|
||||
|
||||
public double getLatitude() {
|
||||
return latitude;
|
||||
}
|
||||
|
||||
public void setLatitude(double latitude) {
|
||||
this.latitude = latitude;
|
||||
}
|
||||
|
||||
public double getLongitudeGcj02() {
|
||||
return longitudeGcj02;
|
||||
}
|
||||
|
||||
public void setLongitudeGcj02(double longitudeGcj02) {
|
||||
this.longitudeGcj02 = longitudeGcj02;
|
||||
}
|
||||
|
||||
public double getLatitudeGcj02() {
|
||||
return latitudeGcj02;
|
||||
}
|
||||
|
||||
public void setLatitudeGcj02(double latitudeGcj02) {
|
||||
this.latitudeGcj02 = latitudeGcj02;
|
||||
}
|
||||
|
||||
public double getLongitudeWgs84() {
|
||||
return longitudeWgs84;
|
||||
}
|
||||
|
||||
public void setLongitudeWgs84(double longitudeWgs84) {
|
||||
this.longitudeWgs84 = longitudeWgs84;
|
||||
}
|
||||
|
||||
public double getLatitudeWgs84() {
|
||||
return latitudeWgs84;
|
||||
}
|
||||
|
||||
public void setLatitudeWgs84(double latitudeWgs84) {
|
||||
this.latitudeWgs84 = latitudeWgs84;
|
||||
}
|
||||
|
||||
public int getSubCount() {
|
||||
return subCount;
|
||||
}
|
||||
|
||||
public void setSubCount(int subCount) {
|
||||
this.subCount = subCount;
|
||||
}
|
||||
|
||||
public boolean isHasAudio() {
|
||||
return hasAudio;
|
||||
}
|
||||
|
||||
public void setHasAudio(boolean hasAudio) {
|
||||
this.hasAudio = hasAudio;
|
||||
}
|
||||
|
||||
public String getStreamId() {
|
||||
return streamId;
|
||||
}
|
||||
|
||||
public void setStreamId(String streamId) {
|
||||
this.streamId = streamId;
|
||||
public void setPtzTypeText(String ptzTypeText) {
|
||||
this.ptzTypeText = ptzTypeText;
|
||||
}
|
||||
|
||||
public String getCreateTime() {
|
||||
@@ -560,11 +457,91 @@ public class DeviceChannel implements Entity<Integer> {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
public int getChannelType() {
|
||||
public Boolean isStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Boolean status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Double getLongitude() {
|
||||
return longitude;
|
||||
}
|
||||
|
||||
public void setLongitude(Double longitude) {
|
||||
this.longitude = longitude;
|
||||
}
|
||||
|
||||
public Double getLatitude() {
|
||||
return latitude;
|
||||
}
|
||||
|
||||
public void setLatitude(Double latitude) {
|
||||
this.latitude = latitude;
|
||||
}
|
||||
|
||||
public Double getLongitudeGcj02() {
|
||||
return longitudeGcj02;
|
||||
}
|
||||
|
||||
public void setLongitudeGcj02(Double longitudeGcj02) {
|
||||
this.longitudeGcj02 = longitudeGcj02;
|
||||
}
|
||||
|
||||
public Double getLatitudeGcj02() {
|
||||
return latitudeGcj02;
|
||||
}
|
||||
|
||||
public void setLatitudeGcj02(Double latitudeGcj02) {
|
||||
this.latitudeGcj02 = latitudeGcj02;
|
||||
}
|
||||
|
||||
public Double getLongitudeWgs84() {
|
||||
return longitudeWgs84;
|
||||
}
|
||||
|
||||
public void setLongitudeWgs84(Double longitudeWgs84) {
|
||||
this.longitudeWgs84 = longitudeWgs84;
|
||||
}
|
||||
|
||||
public Double getLatitudeWgs84() {
|
||||
return latitudeWgs84;
|
||||
}
|
||||
|
||||
public void setLatitudeWgs84(Double latitudeWgs84) {
|
||||
this.latitudeWgs84 = latitudeWgs84;
|
||||
}
|
||||
|
||||
public Integer getSubCount() {
|
||||
return subCount;
|
||||
}
|
||||
|
||||
public void setSubCount(Integer subCount) {
|
||||
this.subCount = subCount;
|
||||
}
|
||||
|
||||
public String getStreamId() {
|
||||
return streamId;
|
||||
}
|
||||
|
||||
public void setStreamId(String streamId) {
|
||||
this.streamId = streamId;
|
||||
}
|
||||
|
||||
public Boolean isHasAudio() {
|
||||
return hasAudio;
|
||||
}
|
||||
|
||||
public void setHasAudio(Boolean hasAudio) {
|
||||
this.hasAudio = hasAudio;
|
||||
}
|
||||
|
||||
public Integer getChannelType() {
|
||||
return channelType;
|
||||
}
|
||||
|
||||
public void setChannelType(int channelType) {
|
||||
public void setChannelType(Integer channelType) {
|
||||
this.channelType = channelType;
|
||||
}
|
||||
|
||||
|
||||
+34
-28
@@ -33,19 +33,21 @@ public class ParentPlatform {
|
||||
* SIP服务国标编码
|
||||
*/
|
||||
@Schema(description = "SIP服务国标编码")
|
||||
@TableField("server_gb_id")
|
||||
private String serverGBId;
|
||||
|
||||
/**
|
||||
* SIP服务国标域
|
||||
*/
|
||||
@Schema(description = "SIP服务国标域")
|
||||
@TableField("server_gb_domain")
|
||||
private String serverGBDomain;
|
||||
|
||||
/**
|
||||
* SIP服务IP
|
||||
*/
|
||||
@Schema(description = "SIP服务IP")
|
||||
private String serverIP;
|
||||
private String serverIp;
|
||||
|
||||
/**
|
||||
* SIP服务端口
|
||||
@@ -57,6 +59,7 @@ public class ParentPlatform {
|
||||
* 设备国标编号
|
||||
*/
|
||||
@Schema(description = "设备国标编号")
|
||||
@TableField("device_gb_id")
|
||||
private String deviceGBId;
|
||||
|
||||
/**
|
||||
@@ -144,7 +147,7 @@ public class ParentPlatform {
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "已被订阅目录信息")
|
||||
private boolean catalogSubscribe;
|
||||
private Boolean catalogSubscribe;
|
||||
|
||||
/**
|
||||
* 已被订阅报警信息
|
||||
@@ -204,11 +207,11 @@ public class ParentPlatform {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public boolean isEnable() {
|
||||
public Boolean isEnable() {
|
||||
return enable;
|
||||
}
|
||||
|
||||
public void setEnable(boolean enable) {
|
||||
public void setEnable(Boolean enable) {
|
||||
this.enable = enable;
|
||||
}
|
||||
|
||||
@@ -236,13 +239,7 @@ public class ParentPlatform {
|
||||
this.serverGBDomain = serverGBDomain;
|
||||
}
|
||||
|
||||
public String getServerIP() {
|
||||
return serverIP;
|
||||
}
|
||||
|
||||
public void setServerIP(String serverIP) {
|
||||
this.serverIP = serverIP;
|
||||
}
|
||||
|
||||
public int getServerPort() {
|
||||
return serverPort;
|
||||
@@ -324,27 +321,27 @@ public class ParentPlatform {
|
||||
this.characterSet = characterSet;
|
||||
}
|
||||
|
||||
public boolean isPtz() {
|
||||
public Boolean isPtz() {
|
||||
return ptz;
|
||||
}
|
||||
|
||||
public void setPtz(boolean ptz) {
|
||||
public void setPtz(Boolean ptz) {
|
||||
this.ptz = ptz;
|
||||
}
|
||||
|
||||
public boolean isRtcp() {
|
||||
public Boolean isRtcp() {
|
||||
return rtcp;
|
||||
}
|
||||
|
||||
public void setRtcp(boolean rtcp) {
|
||||
public void setRtcp(Boolean rtcp) {
|
||||
this.rtcp = rtcp;
|
||||
}
|
||||
|
||||
public boolean isStatus() {
|
||||
public Boolean isStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(boolean status) {
|
||||
public void setStatus(Boolean status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
@@ -364,35 +361,35 @@ public class ParentPlatform {
|
||||
this.catalogId = catalogId;
|
||||
}
|
||||
|
||||
public boolean isCatalogSubscribe() {
|
||||
public Boolean isCatalogSubscribe() {
|
||||
return catalogSubscribe;
|
||||
}
|
||||
|
||||
public void setCatalogSubscribe(boolean catalogSubscribe) {
|
||||
public void setCatalogSubscribe(Boolean catalogSubscribe) {
|
||||
this.catalogSubscribe = catalogSubscribe;
|
||||
}
|
||||
|
||||
public boolean isAlarmSubscribe() {
|
||||
public Boolean isAlarmSubscribe() {
|
||||
return alarmSubscribe;
|
||||
}
|
||||
|
||||
public void setAlarmSubscribe(boolean alarmSubscribe) {
|
||||
public void setAlarmSubscribe(Boolean alarmSubscribe) {
|
||||
this.alarmSubscribe = alarmSubscribe;
|
||||
}
|
||||
|
||||
public boolean isMobilePositionSubscribe() {
|
||||
public Boolean isMobilePositionSubscribe() {
|
||||
return mobilePositionSubscribe;
|
||||
}
|
||||
|
||||
public void setMobilePositionSubscribe(boolean mobilePositionSubscribe) {
|
||||
public void setMobilePositionSubscribe(Boolean mobilePositionSubscribe) {
|
||||
this.mobilePositionSubscribe = mobilePositionSubscribe;
|
||||
}
|
||||
|
||||
public boolean isStartOfflinePush() {
|
||||
public Boolean isStartOfflinePush() {
|
||||
return startOfflinePush;
|
||||
}
|
||||
|
||||
public void setStartOfflinePush(boolean startOfflinePush) {
|
||||
public void setStartOfflinePush(Boolean startOfflinePush) {
|
||||
this.startOfflinePush = startOfflinePush;
|
||||
}
|
||||
|
||||
@@ -428,19 +425,28 @@ public class ParentPlatform {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public boolean isAsMessageChannel() {
|
||||
public Boolean isAsMessageChannel() {
|
||||
return asMessageChannel;
|
||||
}
|
||||
|
||||
public void setAsMessageChannel(boolean asMessageChannel) {
|
||||
public void setAsMessageChannel(Boolean asMessageChannel) {
|
||||
this.asMessageChannel = asMessageChannel;
|
||||
}
|
||||
|
||||
public boolean isAutoPushChannel() {
|
||||
public Boolean isAutoPushChannel() {
|
||||
return autoPushChannel;
|
||||
}
|
||||
|
||||
public void setAutoPushChannel(boolean autoPushChannel) {
|
||||
public void setAutoPushChannel(Boolean autoPushChannel) {
|
||||
this.autoPushChannel = autoPushChannel;
|
||||
}
|
||||
|
||||
public String getServerIp() {
|
||||
return serverIp;
|
||||
}
|
||||
|
||||
public void setServerIp(String serverIp) {
|
||||
this.serverIp = serverIp;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+6
@@ -1,13 +1,17 @@
|
||||
package com.genersoft.iot.vmp.gb28181.bean;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* 国标级联-目录
|
||||
* @author lin
|
||||
*/
|
||||
@TableName("wvp_platform_catalog")
|
||||
@Schema(description = "目录信息")
|
||||
public class PlatformCatalog {
|
||||
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
@@ -29,12 +33,14 @@ public class PlatformCatalog {
|
||||
/**
|
||||
* 子节点数
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "子节点数")
|
||||
private int childrenCount;
|
||||
|
||||
/**
|
||||
* 0 目录, 1 国标通道, 2 直播流
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "类型:0 目录, 1 国标通道, 2 直播流")
|
||||
private int type;
|
||||
|
||||
|
||||
+2
-5
@@ -1,20 +1,17 @@
|
||||
package com.genersoft.iot.vmp.gb28181.bean;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@TableName("wvp_platform_gb_stream")
|
||||
public class PlatformGbStream {
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableId("gb_stream_id")
|
||||
private Integer gbStreamId;
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "平台ID")
|
||||
private String platformId;
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "目录ID")
|
||||
private String catalogId;
|
||||
|
||||
|
||||
+1
@@ -3,4 +3,5 @@ package com.genersoft.iot.vmp.gb28181.transmit;
|
||||
import javax.sip.SipListener;
|
||||
|
||||
public interface ISIPProcessorObserver extends SipListener {
|
||||
|
||||
}
|
||||
|
||||
+6
-6
@@ -36,7 +36,7 @@ public class SIPRequestHeaderPlarformProvider {
|
||||
|
||||
@Autowired
|
||||
private SipConfig sipConfig;
|
||||
|
||||
|
||||
@Autowired
|
||||
private SipLayer sipLayer;
|
||||
|
||||
@@ -51,7 +51,7 @@ public class SIPRequestHeaderPlarformProvider {
|
||||
String sipAddress = parentPlatform.getDeviceIp() + ":" + parentPlatform.getDevicePort();
|
||||
//请求行
|
||||
SipURI requestLine = SipFactory.getInstance().createAddressFactory().createSipURI(parentPlatform.getServerGBId(),
|
||||
parentPlatform.getServerIP() + ":" + parentPlatform.getServerPort());
|
||||
parentPlatform.getServerIp() + ":" + parentPlatform.getServerPort());
|
||||
//via
|
||||
ArrayList<ViaHeader> viaHeaders = new ArrayList<ViaHeader>();
|
||||
ViaHeader viaHeader = SipFactory.getInstance().createHeaderFactory().createViaHeader(parentPlatform.getDeviceIp(),
|
||||
@@ -92,7 +92,7 @@ public class SIPRequestHeaderPlarformProvider {
|
||||
|
||||
|
||||
Request registerRequest = createRegisterRequest(parentPlatform, redisCatchStorage.getCSEQ(), fromTag, toTag, callIdHeader, expires);
|
||||
SipURI requestURI = SipFactory.getInstance().createAddressFactory().createSipURI(parentPlatform.getServerGBId(), parentPlatform.getServerIP() + ":" + parentPlatform.getServerPort());
|
||||
SipURI requestURI = SipFactory.getInstance().createAddressFactory().createSipURI(parentPlatform.getServerGBId(), parentPlatform.getServerIp() + ":" + parentPlatform.getServerPort());
|
||||
if (www == null) {
|
||||
AuthorizationHeader authorizationHeader = SipFactory.getInstance().createHeaderFactory().createAuthorizationHeader("Digest");
|
||||
String username = parentPlatform.getUsername();
|
||||
@@ -177,7 +177,7 @@ public class SIPRequestHeaderPlarformProvider {
|
||||
|
||||
public Request createMessageRequest(ParentPlatform parentPlatform, String content, String fromTag, String viaTag, String toTag, CallIdHeader callIdHeader) throws PeerUnavailableException, ParseException, InvalidArgumentException {
|
||||
Request request = null;
|
||||
String serverAddress = parentPlatform.getServerIP()+ ":" + parentPlatform.getServerPort();
|
||||
String serverAddress = parentPlatform.getServerIp()+ ":" + parentPlatform.getServerPort();
|
||||
// sipuri
|
||||
SipURI requestURI = SipFactory.getInstance().createAddressFactory().createSipURI(parentPlatform.getServerGBId(), serverAddress);
|
||||
// via
|
||||
@@ -216,7 +216,7 @@ public class SIPRequestHeaderPlarformProvider {
|
||||
public SIPRequest createNotifyRequest(ParentPlatform parentPlatform, String content, SubscribeInfo subscribeInfo) throws PeerUnavailableException, ParseException, InvalidArgumentException {
|
||||
SIPRequest request = null;
|
||||
// sipuri
|
||||
SipURI requestURI = SipFactory.getInstance().createAddressFactory().createSipURI(parentPlatform.getServerGBId(), parentPlatform.getServerIP()+ ":" + parentPlatform.getServerPort());
|
||||
SipURI requestURI = SipFactory.getInstance().createAddressFactory().createSipURI(parentPlatform.getServerGBId(), parentPlatform.getServerIp()+ ":" + parentPlatform.getServerPort());
|
||||
// via
|
||||
ArrayList<ViaHeader> viaHeaders = new ArrayList<>();
|
||||
ViaHeader viaHeader = SipFactory.getInstance().createHeaderFactory().createViaHeader(parentPlatform.getDeviceIp(), Integer.parseInt(parentPlatform.getDevicePort()),
|
||||
@@ -276,7 +276,7 @@ public class SIPRequestHeaderPlarformProvider {
|
||||
|
||||
SIPRequest request = null;
|
||||
// sipuri
|
||||
SipURI requestURI = SipFactory.getInstance().createAddressFactory().createSipURI(platform.getServerGBId(), platform.getServerIP()+ ":" + platform.getServerPort());
|
||||
SipURI requestURI = SipFactory.getInstance().createAddressFactory().createSipURI(platform.getServerGBId(), platform.getServerIp()+ ":" + platform.getServerPort());
|
||||
// via
|
||||
ArrayList<ViaHeader> viaHeaders = new ArrayList<>();
|
||||
ViaHeader viaHeader = SipFactory.getInstance().createHeaderFactory().createViaHeader(platform.getDeviceIp(), Integer.parseInt(platform.getDevicePort()),
|
||||
|
||||
+2
-2
@@ -337,8 +337,8 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform {
|
||||
}else {
|
||||
catalogXml.append("<Password></Password>\r\n");
|
||||
}
|
||||
if (!ObjectUtils.isEmpty(channel.getPTZType())) {
|
||||
catalogXml.append("<PTZType>" + channel.getPTZType() + "</PTZType>\r\n");
|
||||
if (!ObjectUtils.isEmpty(channel.getPtzType())) {
|
||||
catalogXml.append("<PTZType>" + channel.getPtzType() + "</PTZType>\r\n");
|
||||
}else {
|
||||
catalogXml.append("<PTZType></PTZType>\r\n");
|
||||
}
|
||||
|
||||
+4
-4
@@ -30,10 +30,10 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
/**
|
||||
* @description:处理接收IPCamera发来的SIP协议请求消息
|
||||
* @author: songww
|
||||
* @date: 2020年5月3日 下午4:42:22
|
||||
* @date: 2020年5月3日 下午4:42:22
|
||||
*/
|
||||
public abstract class SIPRequestProcessorParent {
|
||||
|
||||
@@ -134,7 +134,7 @@ public abstract class SIPRequestProcessorParent {
|
||||
// 兼容国标中的使用编码@域名作为RequestURI的情况
|
||||
SipURI sipURI = (SipURI)request.getRequestURI();
|
||||
if (sipURI.getPort() == -1) {
|
||||
sipURI = SipFactory.getInstance().createAddressFactory().createSipURI(platform.getServerGBId(), platform.getServerIP()+":"+platform.getServerPort());
|
||||
sipURI = SipFactory.getInstance().createAddressFactory().createSipURI(platform.getServerGBId(), platform.getServerIp()+":"+platform.getServerPort());
|
||||
}
|
||||
ResponseAckExtraParam responseAckExtraParam = new ResponseAckExtraParam();
|
||||
responseAckExtraParam.contentTypeHeader = contentTypeHeader;
|
||||
@@ -152,7 +152,7 @@ public abstract class SIPRequestProcessorParent {
|
||||
|
||||
SipURI sipURI = (SipURI)request.getRequestURI();
|
||||
if (sipURI.getPort() == -1) {
|
||||
sipURI = SipFactory.getInstance().createAddressFactory().createSipURI(platform.getServerGBId(), platform.getServerIP()+":"+platform.getServerPort());
|
||||
sipURI = SipFactory.getInstance().createAddressFactory().createSipURI(platform.getServerGBId(), platform.getServerIp()+":"+platform.getServerPort());
|
||||
}
|
||||
ResponseAckExtraParam responseAckExtraParam = new ResponseAckExtraParam();
|
||||
responseAckExtraParam.contentTypeHeader = contentTypeHeader;
|
||||
|
||||
+3
-3
@@ -520,14 +520,14 @@ public class XmlUtil {
|
||||
String ptzTypeFromInfo = XmlUtil.getText(info, "PTZType");
|
||||
if(!ObjectUtils.isEmpty(ptzTypeFromInfo)){
|
||||
try {
|
||||
deviceChannel.setPTZType(Integer.parseInt(ptzTypeFromInfo));
|
||||
deviceChannel.setPtzType(Integer.parseInt(ptzTypeFromInfo));
|
||||
}catch (NumberFormatException e){
|
||||
logger.warn("[xml解析] 从通道数据info中获取PTZType失败: {}", ptzTypeFromInfo);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
deviceChannel.setPTZType(Integer.parseInt(ptzType));
|
||||
deviceChannel.setPtzType(Integer.parseInt(ptzType));
|
||||
}catch (NumberFormatException e){
|
||||
logger.warn("[xml解析] 从通道数据中获取PTZType失败: {}", ptzType);
|
||||
}
|
||||
@@ -644,4 +644,4 @@ public class XmlUtil {
|
||||
}
|
||||
return val;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+83
-29
@@ -1,93 +1,147 @@
|
||||
package com.genersoft.iot.vmp.media.zlm.dto;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.genersoft.iot.vmp.media.zlm.ZLMServerConfig;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
/**
|
||||
* 流媒体服务信息
|
||||
*/
|
||||
@TableName("wvp_media_server")
|
||||
@Schema(description = "流媒体服务信息")
|
||||
public class MediaServerItem{
|
||||
|
||||
@Schema(description = "ID")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "IP")
|
||||
/**
|
||||
* IP
|
||||
*/
|
||||
private String ip;
|
||||
|
||||
@Schema(description = "hook使用的IP(zlm访问WVP使用的IP)")
|
||||
/**
|
||||
* hook使用的IP(zlm访问WVP使用的IP)
|
||||
*/
|
||||
private String hookIp;
|
||||
|
||||
@Schema(description = "SDP IP")
|
||||
/**
|
||||
* SDP IP
|
||||
*/
|
||||
private String sdpIp;
|
||||
|
||||
@Schema(description = "流IP")
|
||||
/**
|
||||
* 流IP
|
||||
*/
|
||||
private String streamIp;
|
||||
|
||||
@Schema(description = "HTTP端口")
|
||||
/**
|
||||
* HTTP端口
|
||||
*/
|
||||
private int httpPort;
|
||||
|
||||
@Schema(description = "HTTPS端口")
|
||||
/**
|
||||
* HTTPS端口
|
||||
*/
|
||||
@TableField("http_ssl_port")
|
||||
private int httpSSlPort;
|
||||
|
||||
@Schema(description = "RTMP端口")
|
||||
/**
|
||||
* RTMP端口
|
||||
*/
|
||||
private int rtmpPort;
|
||||
|
||||
@Schema(description = "RTMPS端口")
|
||||
/**
|
||||
* RTMPS端口
|
||||
*/
|
||||
@TableField("rtmp_ssl_port")
|
||||
private int rtmpSSlPort;
|
||||
|
||||
@Schema(description = "RTP收流端口(单端口模式有用)")
|
||||
/**
|
||||
* RTP收流端口(单端口模式有用)
|
||||
*/
|
||||
private int rtpProxyPort;
|
||||
|
||||
@Schema(description = "RTSP端口")
|
||||
/**
|
||||
* RTSP端口
|
||||
*/
|
||||
private int rtspPort;
|
||||
|
||||
@Schema(description = "RTSPS端口")
|
||||
/**
|
||||
* RTSPS端口
|
||||
*/
|
||||
@TableField("rtsp_ssl_port")
|
||||
private int rtspSSLPort;
|
||||
|
||||
@Schema(description = "是否开启自动配置ZLM")
|
||||
/**
|
||||
* 是否开启自动配置ZLM
|
||||
*/
|
||||
private boolean autoConfig;
|
||||
|
||||
@Schema(description = "ZLM鉴权参数")
|
||||
/**
|
||||
* ZLM鉴权参数
|
||||
*/
|
||||
private String secret;
|
||||
|
||||
@Schema(description = "keepalive hook触发间隔,单位秒")
|
||||
/**
|
||||
* keepalive hook触发间隔,单位秒
|
||||
*/
|
||||
private Float hookAliveInterval;
|
||||
|
||||
@Schema(description = "是否使用多端口模式")
|
||||
/**
|
||||
* 是否使用多端口模式
|
||||
*/
|
||||
private boolean rtpEnable;
|
||||
|
||||
@Schema(description = "状态")
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private boolean status;
|
||||
|
||||
@Schema(description = "多端口RTP收流端口范围")
|
||||
/**
|
||||
* 多端口RTP收流端口范围
|
||||
*/
|
||||
private String rtpPortRange;
|
||||
|
||||
@Schema(description = "RTP发流端口范围")
|
||||
/**
|
||||
* RTP发流端口范围
|
||||
*/
|
||||
private String sendRtpPortRange;
|
||||
|
||||
@Schema(description = "assist服务端口")
|
||||
/**
|
||||
* assist服务端口
|
||||
*/
|
||||
private int recordAssistPort;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String createTime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private String updateTime;
|
||||
|
||||
@Schema(description = "上次心跳时间")
|
||||
/**
|
||||
* 上次心跳时间
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String lastKeepaliveTime;
|
||||
|
||||
@Schema(description = "是否是默认ZLM")
|
||||
/**
|
||||
* 是否是默认ZLM
|
||||
*/
|
||||
private boolean defaultServer;
|
||||
|
||||
@Schema(description = "当前使用到的端口")
|
||||
/**
|
||||
* 当前使用到的端口
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private int currentPort;
|
||||
|
||||
|
||||
public MediaServerItem() {
|
||||
}
|
||||
public MediaServerItem() { }
|
||||
|
||||
public MediaServerItem(ZLMServerConfig zlmServerConfig, String sipIp) {
|
||||
id = zlmServerConfig.getGeneralMediaServerId();
|
||||
|
||||
+3
-3
@@ -45,7 +45,7 @@ import java.util.concurrent.TimeUnit;
|
||||
/**
|
||||
* 设备业务(目录订阅)
|
||||
*/
|
||||
@Service
|
||||
@Service("WvpDeviceServiceImpl")
|
||||
public class DeviceServiceImpl implements IDeviceService {
|
||||
|
||||
private final static Logger logger = LoggerFactory.getLogger(DeviceServiceImpl.class);
|
||||
@@ -110,7 +110,7 @@ public class DeviceServiceImpl implements IDeviceService {
|
||||
}
|
||||
device.setUpdateTime(now);
|
||||
device.setKeepaliveTime(now);
|
||||
if (device.getKeepaliveIntervalTime() == 0) {
|
||||
if (device.getKeepaliveIntervalTime() == null) {
|
||||
// 默认心跳间隔60
|
||||
device.setKeepaliveIntervalTime(60);
|
||||
}
|
||||
@@ -157,7 +157,7 @@ public class DeviceServiceImpl implements IDeviceService {
|
||||
// TODO 如果设备下的通道级联到了其他平台,那么需要发送事件或者notify给上级平台
|
||||
}
|
||||
}else {
|
||||
if (deviceChannelMapper.isChannel(device.getDeviceId())) {
|
||||
if (!deviceChannelMapper.isChannel(device.getDeviceId())) {
|
||||
logger.info("[设备上线]: {},通道数为0,查询通道信息", device.getDeviceId());
|
||||
sync(device);
|
||||
}
|
||||
|
||||
+1
-1
@@ -82,7 +82,7 @@ public class GbStreamServiceImpl extends ServiceImpl<GbStreamMapper, GbStream> i
|
||||
gbStream.setCatalogId(catalogId);
|
||||
gbStream.setPlatformId(platformId);
|
||||
// TODO 修改为批量提交
|
||||
platformGbStreamMapper.add(gbStream);
|
||||
platformGbStreamMapper.insert(gbStream);
|
||||
logger.info("[关联通道]直播流通道 平台:{}, 共需关联通道数:{}, 已关联:{}", platformId, gbStreams.size(), i + 1);
|
||||
DeviceChannel deviceChannelListByStream = getDeviceChannelListByStreamWithStatus(gbStream, catalogId, parentPlatform);
|
||||
deviceChannelList.add(deviceChannelListByStream);
|
||||
|
||||
+1
-1
@@ -278,7 +278,7 @@ public class PlatformServiceImpl implements IPlatformService {
|
||||
subscribeInfo.setEventType("Catalog");
|
||||
int random = (int) Math.floor(Math.random() * 10000);
|
||||
subscribeInfo.setEventId(random + "");
|
||||
subscribeInfo.setSimulatedCallId(UUID.randomUUID().toString().replace("-", "") + "@" + parentPlatform.getServerIP());
|
||||
subscribeInfo.setSimulatedCallId(UUID.randomUUID().toString().replace("-", "") + "@" + parentPlatform.getServerIp());
|
||||
subscribeInfo.setSimulatedFromTag(UUID.randomUUID().toString().replace("-", ""));
|
||||
subscribeInfo.setSimulatedToTag(UUID.randomUUID().toString().replace("-", ""));
|
||||
subscribeHolder.putCatalogSubscribe(parentPlatform.getServerGBId(), subscribeInfo);
|
||||
|
||||
+1
-5
@@ -559,11 +559,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
||||
|
||||
@Override
|
||||
public ResourceBaseInfo getOverview() {
|
||||
|
||||
int total = streamProxyMapper.getAllCount();
|
||||
int online = streamProxyMapper.getOnline();
|
||||
|
||||
return new ResourceBaseInfo(total, online);
|
||||
return streamProxyMapper.getOverview();
|
||||
}
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -184,13 +184,13 @@ public class StreamPushServiceImpl extends ServiceImpl<StreamPushMapper, StreamP
|
||||
|
||||
@Override
|
||||
public StreamPushItem getPush(String app, String streamId) {
|
||||
return streamPushMapper.selectOne(app, streamId);
|
||||
return streamPushMapper.getByAppAndStream(app, streamId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean stop(String app, String streamId) {
|
||||
logger.info("[推流 ] 停止流: {}/{}", app, streamId);
|
||||
StreamPushItem streamPushItem = streamPushMapper.selectOne(app, streamId);
|
||||
StreamPushItem streamPushItem = streamPushMapper.getByAppAndStream(app, streamId);
|
||||
if (streamPushItem != null) {
|
||||
gbStreamService.sendCatalogMsg(streamPushItem, CatalogEvent.DEL);
|
||||
}
|
||||
|
||||
-27
@@ -2,12 +2,8 @@ package com.genersoft.iot.vmp.storager.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.apache.ibatis.annotations.Insert;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -15,33 +11,10 @@ import java.util.List;
|
||||
* 用于存储设备的报警信息
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface DeviceAlarmMapper extends BaseMapper<DeviceAlarm> {
|
||||
|
||||
|
||||
@Select( value = {" <script>" +
|
||||
" SELECT * FROM wvp_device_alarm " +
|
||||
" WHERE 1=1 " +
|
||||
" <if test=\"deviceId != null\" > AND device_id = #{deviceId}</if>" +
|
||||
" <if test=\"alarmPriority != null\" > AND alarm_priority = #{alarmPriority} </if>" +
|
||||
" <if test=\"alarmMethod != null\" > AND alarm_method = #{alarmMethod} </if>" +
|
||||
" <if test=\"alarmType != null\" > AND alarm_type = #{alarmType} </if>" +
|
||||
" <if test=\"startTime != null\" > AND alarm_time >= #{startTime} </if>" +
|
||||
" <if test=\"endTime != null\" > AND alarm_time <= #{endTime} </if>" +
|
||||
" ORDER BY alarm_time ASC " +
|
||||
" </script>"})
|
||||
List<DeviceAlarm> query(@Param("deviceId") String deviceId, @Param("alarmPriority") String alarmPriority, @Param("alarmMethod") String alarmMethod,
|
||||
@Param("alarmType") String alarmType, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
|
||||
|
||||
@Delete(" <script>" +
|
||||
"DELETE FROM wvp_device_alarm WHERE 1=1 " +
|
||||
" <if test=\"deviceIdList != null and id == null \" > AND device_id in " +
|
||||
"<foreach collection='deviceIdList' item='item' open='(' separator=',' close=')' > #{item}</foreach>" +
|
||||
"</if>" +
|
||||
" <if test=\"time != null and id == null \" > AND alarm_time <= #{time}</if>" +
|
||||
" <if test=\"id != null\" > AND id = #{id}</if>" +
|
||||
" </script>"
|
||||
)
|
||||
int clearAlarmBeforeTime(@Param("id") Integer id, @Param("deviceIdList") List<String> deviceIdList, @Param("time") String time);
|
||||
}
|
||||
|
||||
+1
-3
@@ -7,9 +7,8 @@ import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannelInPlatform;
|
||||
import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
|
||||
import com.genersoft.iot.vmp.web.gb28181.dto.DeviceChannelExtend;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -17,7 +16,6 @@ import java.util.List;
|
||||
* 用于存储设备通道信息
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface DeviceChannelMapper extends BaseMapper<DeviceChannel> {
|
||||
|
||||
List<DeviceChannel> queryChannels(@Param("deviceId") String deviceId, @Param("parentChannelId") String parentChannelId
|
||||
|
||||
+2
-5
@@ -3,17 +3,14 @@ package com.genersoft.iot.vmp.storager.dao;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用于存储设备信息
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
@Repository("wvpDeviceMapper")
|
||||
public interface DeviceMapper extends BaseMapper<Device> {
|
||||
|
||||
Device getDeviceByDeviceId(String deviceId);
|
||||
|
||||
+1
-3
@@ -8,14 +8,12 @@ import com.genersoft.iot.vmp.gb28181.bean.GbStream;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
|
||||
import com.genersoft.iot.vmp.service.bean.GPSMsgInfo;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface GbStreamMapper extends BaseMapper<GbStream> {
|
||||
|
||||
List<GbStream> selectAll(GbStream entity);
|
||||
|
||||
-2
@@ -3,11 +3,9 @@ package com.genersoft.iot.vmp.storager.dao;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface MediaServerItemMapper extends BaseMapper<MediaServerItem> {
|
||||
|
||||
}
|
||||
|
||||
+1
-3
@@ -5,9 +5,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
|
||||
import com.genersoft.iot.vmp.storager.dao.dto.ChannelSourceInfo;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -15,7 +14,6 @@ import java.util.List;
|
||||
* 用于存储上级平台
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface ParentPlatformMapper extends BaseMapper<ParentPlatform> {
|
||||
|
||||
List<ParentPlatform> getParentPlatformList();
|
||||
|
||||
+3
-38
@@ -1,66 +1,31 @@
|
||||
package com.genersoft.iot.vmp.storager.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.PlatformCatalog;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface PlatformCatalogMapper {
|
||||
public interface PlatformCatalogMapper extends BaseMapper<PlatformCatalog> {
|
||||
|
||||
@Insert("INSERT INTO wvp_platform_catalog (id, name, platform_id, parent_id, civil_code, business_group_id) VALUES" +
|
||||
"(#{id}, #{name}, #{platformId}, #{parentId}, #{civilCode}, #{businessGroupId})")
|
||||
int add(PlatformCatalog platformCatalog);
|
||||
|
||||
@Delete("DELETE from wvp_platform_catalog WHERE platform_id=#{platformId} and id=#{id}")
|
||||
int del(@Param("platformId") String platformId, @Param("id") String id);
|
||||
|
||||
@Delete("DELETE from wvp_platform_catalog WHERE platform_id=#{platformId}")
|
||||
int delByPlatformId(@Param("platformId") String platformId);
|
||||
|
||||
@Select("SELECT pc.*, count(pc2.id) as children_count from wvp_platform_catalog pc " +
|
||||
"left join wvp_platform_catalog pc2 on pc.id = pc2.parent_id " +
|
||||
"WHERE pc.parent_id=#{parentId} AND pc.platform_id=#{platformId} " +
|
||||
"group by pc.id, pc.name, pc.platform_id, pc.business_group_id, pc.civil_code, pc.parent_id")
|
||||
List<PlatformCatalog> selectByParentId(@Param("platformId") String platformId, @Param("parentId") String parentId);
|
||||
|
||||
@Update(value = {" <script>" +
|
||||
"UPDATE wvp_platform_catalog " +
|
||||
"SET name=#{platformCatalog.name}" +
|
||||
"WHERE id=#{platformCatalog.id} and platform_id=#{platformCatalog.platformId}"+
|
||||
"</script>"})
|
||||
int update(@Param("platformCatalog") PlatformCatalog platformCatalog);
|
||||
|
||||
@Select("SELECT *, (SELECT COUNT(1) from wvp_platform_catalog where parent_id = pc.id) as children_count from wvp_platform_catalog pc WHERE pc.platform_id=#{platformId}")
|
||||
List<PlatformCatalog> selectByPlatForm(@Param("platformId") String platformId);
|
||||
|
||||
@Select("SELECT pc.* FROM wvp_platform_catalog pc WHERE pc.id = (SELECT pp.catalog_id from wvp_platform pp WHERE pp.server_gb_id=#{platformId})")
|
||||
PlatformCatalog selectDefaultByPlatFormId(@Param("platformId") String platformId);
|
||||
|
||||
@Select("SELECT pc.id as channel_id, pc.name, pc.civil_code, pc.business_group_id,'1' as parental, pc.parent_id " +
|
||||
" from wvp_platform_catalog pc WHERE pc.platform_id=#{platformId}")
|
||||
List<DeviceChannel> queryCatalogInPlatform(@Param("platformId") String platformId);
|
||||
|
||||
@Select("SELECT *, " +
|
||||
"(SELECT COUNT(1) from wvp_platform_catalog where parent_id = pc.id) as children_count " +
|
||||
" from wvp_platform_catalog pc " +
|
||||
" WHERE pc.id=#{id} and pc.platform_id=#{platformId}")
|
||||
PlatformCatalog selectByPlatFormAndCatalogId(@Param("platformId") String platformId, @Param("id") String id);
|
||||
|
||||
|
||||
@Delete("<script> "+
|
||||
"DELETE from wvp_platform_catalog where platform_id=#{platformId} and id in " +
|
||||
"<foreach collection='ids' item='item' open='(' separator=',' close=')'>" +
|
||||
"#{item} " +
|
||||
"</foreach>" +
|
||||
"</script>")
|
||||
int deleteAll(String platformId, List<String> ids);
|
||||
|
||||
@Select("SELECT id from wvp_platform_catalog WHERE platform_id=#{platformId} and parent_id = #{id}")
|
||||
List<String> queryCatalogFromParent(@Param("id") String id, @Param("platformId") String platformId);
|
||||
}
|
||||
|
||||
-72
@@ -5,118 +5,46 @@ import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.PlatformCatalog;
|
||||
import com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.apache.ibatis.annotations.Insert;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface PlatformChannelMapper {
|
||||
|
||||
/**
|
||||
* 查询列表里已经关联的
|
||||
*/
|
||||
@Select("<script> "+
|
||||
"SELECT device_channel_id from wvp_platform_gb_channel WHERE platform_id=#{platformId} AND device_channel_id in" +
|
||||
"<foreach collection='channelReduces' open='(' item='item' separator=',' close=')'> #{item.id}</foreach>" +
|
||||
"</script>")
|
||||
List<Integer> findChannelRelatedPlatform(@Param("platformId") String platformId, @Param("channelReduces") List<ChannelReduce> channelReduces);
|
||||
|
||||
@Insert("<script> "+
|
||||
"INSERT INTO wvp_platform_gb_channel (platform_id, device_channel_id, catalog_id) VALUES" +
|
||||
"<foreach collection='channelReducesToAdd' item='item' separator=','>" +
|
||||
" (#{platformId}, #{item.id} , #{item.catalogId} )" +
|
||||
"</foreach>" +
|
||||
"</script>")
|
||||
int addChannels(@Param("platformId") String platformId, @Param("channelReducesToAdd") List<ChannelReduce> channelReducesToAdd);
|
||||
|
||||
@Delete("<script> "+
|
||||
"DELETE from wvp_platform_gb_channel WHERE platform_id=#{platformId} AND device_channel_id in" +
|
||||
"<foreach collection='channelReducesToDel' item='item' open='(' separator=',' close=')' > #{item.id}</foreach>" +
|
||||
"</script>")
|
||||
int delChannelForGB(@Param("platformId") String platformId, @Param("channelReducesToDel") List<ChannelReduce> channelReducesToDel);
|
||||
|
||||
@Delete("<script> "+
|
||||
"DELETE from wvp_platform_gb_channel WHERE device_channel_id in " +
|
||||
"( select temp.device_channel_id from " +
|
||||
"(select pgc.device_channel_id from wvp_platform_gb_channel pgc " +
|
||||
"left join wvp_device_channel dc on dc.id = pgc.device_channel_id where dc.device_id =#{deviceId} " +
|
||||
") temp)" +
|
||||
"</script>")
|
||||
int delChannelForDeviceId(String deviceId);
|
||||
|
||||
@Delete("<script> "+
|
||||
"DELETE from wvp_platform_gb_channel WHERE platform_id=#{platformId}" +
|
||||
"</script>")
|
||||
int cleanChannelForGB(String platformId);
|
||||
|
||||
@Select("SELECT dc.* from wvp_platform_gb_channel pgc left join wvp_device_channel dc on dc.id = pgc.device_channel_id WHERE dc.channel_id=#{channelId} and pgc.platform_id=#{platformId}")
|
||||
List<DeviceChannel> queryChannelInParentPlatform(@Param("platformId") String platformId, @Param("channelId") String channelId);
|
||||
|
||||
@Select("SELECT dc.* from wvp_platform_gb_channel pgc left join wvp_device_channel dc on dc.id = pgc.device_channel_id WHERE pgc.platform_id=#{platformId} and pgc.catalog_id=#{catalogId}")
|
||||
List<DeviceChannel> queryAllChannelInCatalog(@Param("platformId") String platformId, @Param("catalogId") String catalogId);
|
||||
|
||||
@Select(" select dc.channel_id as id, dc.name as name, pgc.platform_id as platform_id, pgc.catalog_id as parent_id, 0 as children_count, 1 as type " +
|
||||
" from wvp_device_channel dc left join wvp_platform_gb_channel pgc on dc.id = pgc.device_channel_id " +
|
||||
" where pgc.platform_id=#{platformId} and pgc.catalog_id=#{catalogId}")
|
||||
List<PlatformCatalog> queryChannelInParentPlatformAndCatalog(@Param("platformId") String platformId, @Param("catalogId") String catalogId);
|
||||
|
||||
@Select("select d.*\n" +
|
||||
"from wvp_platform_gb_channel pgc\n" +
|
||||
" left join wvp_device_channel dc on dc.id = pgc.device_channel_id\n" +
|
||||
" left join wvp_device d on dc.device_id = d.device_id\n" +
|
||||
"where dc.channel_id = #{channelId} and pgc.platform_id=#{platformId}")
|
||||
List<Device> queryVideoDeviceByPlatformIdAndChannelId(@Param("platformId") String platformId, @Param("channelId") String channelId);
|
||||
|
||||
@Delete("<script> "+
|
||||
"DELETE from wvp_platform_gb_channel WHERE platform_id=#{platformId} and catalog_id=#{id}" +
|
||||
"</script>")
|
||||
int delByCatalogId(@Param("platformId") String platformId, @Param("id") String id);
|
||||
|
||||
@Delete("<script> "+
|
||||
"DELETE from wvp_platform_gb_channel WHERE catalog_id=#{parentId} AND platform_id=#{platformId} AND channel_id=#{id}" +
|
||||
"</script>")
|
||||
int delByCatalogIdAndChannelIdAndPlatformId(PlatformCatalog platformCatalog);
|
||||
|
||||
@Select("<script> " +
|
||||
"SELECT " +
|
||||
"pp.* " +
|
||||
"FROM " +
|
||||
"wvp_platform pp " +
|
||||
"left join wvp_platform_gb_channel pgc on " +
|
||||
"pp.server_gb_id = pgc.platform_id " +
|
||||
"left join wvp_device_channel dc on " +
|
||||
"dc.id = pgc.device_channel_id " +
|
||||
"WHERE " +
|
||||
"dc.channel_id = #{channelId} and pp.status = true " +
|
||||
"AND pp.server_gb_id IN" +
|
||||
"<foreach collection='platforms' item='item' open='(' separator=',' close=')' > #{item}</foreach>" +
|
||||
"</script> ")
|
||||
List<ParentPlatform> queryPlatFormListForGBWithGBId(@Param("channelId") String channelId, @Param("platforms") List<String> platforms);
|
||||
|
||||
@Delete("<script> " +
|
||||
"DELETE from wvp_platform_gb_channel WHERE platform_id=#{serverGBId}" +
|
||||
"</script>")
|
||||
void delByPlatformId(String serverGBId);
|
||||
|
||||
@Delete("<script> " +
|
||||
"DELETE from wvp_platform_gb_channel WHERE platform_id=#{platformId} " +
|
||||
" <if test=\"catalogId != null\" > and catalog_id=#{catalogId}</if>" +
|
||||
"</script>")
|
||||
int delChannelForGBByCatalogId(@Param("platformId") String platformId, @Param("catalogId") String catalogId);
|
||||
|
||||
@Select("select dc.channel_id dc.device_id,dc.name,d.manufacturer,d.model,d.firmware\n" +
|
||||
"from wvp_platform_gb_channel pgc\n" +
|
||||
" left join wvp_device_channel dc on dc.id = pgc.device_channel_id\n" +
|
||||
" left join wvp_device d on dc.device_id = d.device_id\n" +
|
||||
"where dc.channel_id = #{channelId} and pgc.platform_id=#{platformId}")
|
||||
List<Device> queryDeviceInfoByPlatformIdAndChannelId(@Param("platformId") String platformId, @Param("channelId") String channelId);
|
||||
|
||||
@Select("SELECT pgc.platform_id from wvp_platform_gb_channel pgc left join wvp_device_channel dc on dc.id = pgc.device_channel_id WHERE dc.channel_id='${channelId}'")
|
||||
List<String> queryParentPlatformByChannelId(String channelId);
|
||||
}
|
||||
|
||||
+4
-73
@@ -1,108 +1,39 @@
|
||||
package com.genersoft.iot.vmp.storager.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.GbStream;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.PlatformCatalog;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.PlatformGbStream;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface PlatformGbStreamMapper {
|
||||
public interface PlatformGbStreamMapper extends BaseMapper<PlatformGbStream> {
|
||||
|
||||
@Insert("INSERT INTO wvp_platform_gb_stream (gb_stream_id, platform_id, catalog_id) VALUES" +
|
||||
"( #{gbStreamId}, #{platformId}, #{catalogId})")
|
||||
int add(PlatformGbStream platformGbStream);
|
||||
|
||||
|
||||
@Insert("<script> " +
|
||||
"INSERT into wvp_platform_gb_stream " +
|
||||
"(gb_stream_id, platform_id, catalog_id) " +
|
||||
"values " +
|
||||
"<foreach collection='streamPushItems' index='index' item='item' separator=','> " +
|
||||
"(#{item.gbStreamId}, #{item.platform_id}, #{item.catalogId})" +
|
||||
"</foreach> " +
|
||||
"</script>")
|
||||
int batchAdd(List<StreamPushItem> streamPushItems);
|
||||
|
||||
@Delete("DELETE from wvp_platform_gb_stream WHERE gb_stream_id = (select gb_stream_id from wvp_gb_stream where app=#{app} AND stream=#{stream})")
|
||||
int delByAppAndStream(@Param("app") String app, @Param("stream") String stream);
|
||||
|
||||
@Delete("DELETE from wvp_platform_gb_stream WHERE platform_id=#{platformId}")
|
||||
int delByPlatformId(String platformId);
|
||||
|
||||
@Select("SELECT " +
|
||||
"pp.* " +
|
||||
"FROM " +
|
||||
"wvp_platform_gb_stream pgs " +
|
||||
"LEFT JOIN wvp_platform pp ON pp.server_gb_id = pgs.platform_id " +
|
||||
"LEFT join wvp_gb_stream gs ON gs.gb_stream_id = pgs.gb_stream_id " +
|
||||
"WHERE " +
|
||||
"gs.app =#{app} " +
|
||||
"AND gs.stream =#{stream} ")
|
||||
List<ParentPlatform> selectByAppAndStream(@Param("app") String app, @Param("stream") String stream);
|
||||
|
||||
@Select("SELECT pgs.*, gs.gb_id from wvp_platform_gb_stream pgs " +
|
||||
"LEFT join wvp_gb_stream gs ON pgs.gb_stream_id = gs.gb_stream_id " +
|
||||
"WHERE gs.app=#{app} AND gs.stream=#{stream} AND pgs.platform_id=#{platformId}")
|
||||
StreamProxyItem selectOne(@Param("app") String app, @Param("stream") String stream, @Param("platformId") String platformId);
|
||||
|
||||
@Select("select gs.* \n" +
|
||||
"from wvp_gb_stream gs\n" +
|
||||
" left join wvp_platform_gb_stream pgs\n" +
|
||||
" on gs.gb_stream_id = pgs.gb_stream_id\n" +
|
||||
"where pgs.platform_id=#{platformId} and pgs.catalog_id=#{catalogId}")
|
||||
List<GbStream> queryChannelInParentPlatformAndCatalog(@Param("platformId") String platformId, @Param("catalogId") String catalogId);
|
||||
|
||||
@Select("select gs.gb_id as id, gs.name as name, pgs.platform_id as platform_id, pgs.catalog_id as catalog_id , 0 as children_count, 2 as type\n" +
|
||||
"from wvp_gb_stream gs\n" +
|
||||
" left join wvp_platform_gb_stream pgs\n" +
|
||||
" on gs.gb_stream_id = pgs.gb_stream_id\n" +
|
||||
"where pgs.platform_id=#{platformId} and pgs.catalog_id=#{catalogId}")
|
||||
List<PlatformCatalog> queryChannelInParentPlatformAndCatalogForCatalog(@Param("platformId") String platformId, @Param("catalogId") String catalogId);
|
||||
|
||||
@Select("<script> " +
|
||||
"SELECT " +
|
||||
"pp.* " +
|
||||
"FROM " +
|
||||
"wvp_platform pp " +
|
||||
"left join wvp_platform_gb_stream pgs on " +
|
||||
"pp.server_gb_id = pgs.platform_id " +
|
||||
"left join wvp_gb_stream gs " +
|
||||
"on gs.gb_stream_id = pgs.gb_stream_id " +
|
||||
"WHERE " +
|
||||
"gs.app = #{app} " +
|
||||
"AND gs.stream = #{stream}" +
|
||||
"AND pp.server_gb_id IN" +
|
||||
"<foreach collection='platforms' item='item' open='(' separator=',' close=')' > #{item}</foreach>" +
|
||||
"</script> ")
|
||||
List<ParentPlatform> queryPlatFormListForGBWithGBId(@Param("app") String app, @Param("stream") String stream, @Param("platforms") List<String> platforms);
|
||||
|
||||
@Delete("DELETE from wvp_platform_gb_stream WHERE gb_stream_id = (select id from wvp_gb_stream where app=#{app} AND stream=#{stream}) AND platform_id=#{platformId}")
|
||||
int delByAppAndStreamAndPlatform(String app, String stream, String platformId);
|
||||
|
||||
@Delete("<script> "+
|
||||
"DELETE from wvp_platform_gb_stream where gb_stream_id in " +
|
||||
"<foreach collection='gbStreams' item='item' open='(' separator=',' close=')' >" +
|
||||
"#{item.gbStreamId}" +
|
||||
"</foreach>" +
|
||||
"</script>")
|
||||
void delByGbStreams(List<GbStream> gbStreams);
|
||||
|
||||
@Delete("<script> "+
|
||||
"DELETE from wvp_platform_gb_stream where platform_id=#{platformId} and gb_stream_id in " +
|
||||
"<foreach collection='gbStreams' item='item' open='(' separator=',' close=')'>" +
|
||||
"#{item.gbStreamId} " +
|
||||
"</foreach>" +
|
||||
"</script>")
|
||||
void delByAppAndStreamsByPlatformId(@Param("gbStreams") List<GbStream> gbStreams, @Param("platformId") String platformId);
|
||||
|
||||
@Delete("DELETE from wvp_platform_gb_stream WHERE platform_id=#{platformId} and catalog_id=#{catalogId}")
|
||||
int delByPlatformAndCatalogId(@Param("platformId") String platformId, @Param("catalogId") String catalogId);
|
||||
}
|
||||
|
||||
+3
-22
@@ -4,51 +4,32 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
|
||||
import com.genersoft.iot.vmp.vmanager.bean.ResourceBaseInfo;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface StreamProxyMapper extends BaseMapper<StreamProxyItem> {
|
||||
|
||||
Page<StreamProxyItem> listDetailByPage(Page page, StreamProxyItem entity);
|
||||
|
||||
List<StreamProxyItem> selectForEnable(boolean enable);
|
||||
|
||||
StreamProxyItem selectOne(@Param("app") String app, @Param("stream") String stream);
|
||||
StreamProxyItem getByAppAndStream(@Param("app") String app, @Param("stream") String stream);
|
||||
|
||||
List<StreamProxyItem> selectForEnableInMediaServer( @Param("id") String id, @Param("enable") boolean enable);
|
||||
|
||||
@Select("SELECT st.*, pgs.gb_id, pgs.name, pgs.longitude, pgs.latitude FROM wvp_stream_proxy st " +
|
||||
"LEFT join wvp_gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream " +
|
||||
"WHERE st.media_server_id= #{id} order by st.create_time desc")
|
||||
List<StreamProxyItem> selectInMediaServer(String id);
|
||||
|
||||
@Update("UPDATE wvp_stream_proxy " +
|
||||
"SET status=#{status} " +
|
||||
"WHERE media_server_id=#{mediaServerId}")
|
||||
void updateStatusByMediaServerId(@Param("mediaServerId") String mediaServerId, @Param("status") boolean status);
|
||||
|
||||
@Update("UPDATE wvp_stream_proxy " +
|
||||
"SET status=#{status} " +
|
||||
"WHERE app=#{app} AND stream=#{stream}")
|
||||
int updateStatus(@Param("app") String app, @Param("stream") String stream, @Param("status") boolean status);
|
||||
|
||||
@Delete("DELETE FROM wvp_stream_proxy WHERE enable_remove_none_reader=true AND media_server_id=#{mediaServerId}")
|
||||
void deleteAutoRemoveItemByMediaServerId(String mediaServerId);
|
||||
|
||||
@Select("SELECT st.*, pgs.gb_id, pgs.name, pgs.longitude, pgs.latitude FROM wvp_stream_proxy st LEFT join wvp_gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream WHERE st.enable_remove_none_reader=true AND st.media_server_id=#{mediaServerId} order by st.create_time desc")
|
||||
List<StreamProxyItem> selectAutoRemoveItemByMediaServerId(String mediaServerId);
|
||||
|
||||
@Select("select count(1) as total, sum(status) as online from wvp_stream_proxy")
|
||||
ResourceBaseInfo getOverview();
|
||||
|
||||
@Select("select count(1) from wvp_stream_proxy")
|
||||
|
||||
int getAllCount();
|
||||
|
||||
@Select("select count(1) from wvp_stream_proxy where status = true")
|
||||
int getOnline();
|
||||
}
|
||||
|
||||
+3
-5
@@ -1,18 +1,16 @@
|
||||
package com.genersoft.iot.vmp.storager.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.GbStream;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
|
||||
import com.genersoft.iot.vmp.service.bean.StreamPushItemFromRedis;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface StreamPushMapper extends BaseMapper<StreamPushItem> {
|
||||
|
||||
int delAll(List<StreamPushItem> streamPushItems);
|
||||
@@ -23,7 +21,7 @@ public interface StreamPushMapper extends BaseMapper<StreamPushItem> {
|
||||
|
||||
List<StreamPushItem> selectAll();
|
||||
|
||||
StreamPushItem selectOne(@Param("app") String app, @Param("stream") String stream);
|
||||
StreamPushItem getByAppAndStream(@Param("app") String app, @Param("stream") String stream);
|
||||
|
||||
int addAll(List<StreamPushItem> streamPushItems);
|
||||
|
||||
|
||||
+7
-4
@@ -747,7 +747,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
||||
*/
|
||||
@Override
|
||||
public StreamProxyItem queryStreamProxy(String app, String stream){
|
||||
return streamProxyMapper.selectOne(app, stream);
|
||||
return streamProxyMapper.getByAppAndStream(app, stream);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -805,7 +805,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
||||
|
||||
@Override
|
||||
public StreamProxyItem getStreamProxyByAppAndStream(String app, String streamId) {
|
||||
return streamProxyMapper.selectOne(app, streamId);
|
||||
return streamProxyMapper.getByAppAndStream(app, streamId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -862,7 +862,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
||||
}
|
||||
}
|
||||
}
|
||||
int result = catalogMapper.add(platformCatalog);
|
||||
int result = catalogMapper.insert(platformCatalog);
|
||||
if (result > 0) {
|
||||
DeviceChannel deviceChannel = getDeviceChannelByCatalog(platformCatalog);
|
||||
eventPublisher.catalogEventPublish(platformCatalog.getPlatformId(), deviceChannel, CatalogEvent.ADD);
|
||||
@@ -958,7 +958,10 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
||||
|
||||
@Override
|
||||
public int updateCatalog(PlatformCatalog platformCatalog) {
|
||||
int result = catalogMapper.update(platformCatalog);
|
||||
int result = catalogMapper.update(platformCatalog, Wrappers.<PlatformCatalog>lambdaUpdate()
|
||||
.eq(PlatformCatalog::getId, platformCatalog.getId())
|
||||
.eq(PlatformCatalog::getPlatformId, platformCatalog.getPlatformId()));
|
||||
|
||||
if (result > 0) {
|
||||
DeviceChannel deviceChannel = getDeviceChannelByCatalog(platformCatalog);
|
||||
eventPublisher.catalogEventPublish(platformCatalog.getPlatformId(), deviceChannel, CatalogEvent.UPDATE);
|
||||
|
||||
-899
@@ -1,899 +0,0 @@
|
||||
//package com.genersoft.iot.vmp.utils.redis;
|
||||
//
|
||||
//import com.alibaba.fastjson2.JSONObject;
|
||||
//import com.genersoft.iot.vmp.utils.SpringBeanFactory;
|
||||
//import org.springframework.data.redis.core.*;
|
||||
//import org.springframework.util.CollectionUtils;
|
||||
//
|
||||
//import java.util.*;
|
||||
//import java.util.concurrent.TimeUnit;
|
||||
//
|
||||
///**
|
||||
// * Redis工具类
|
||||
// * @author swwheihei
|
||||
// * @date 2020年5月6日 下午8:27:29
|
||||
// */
|
||||
//@SuppressWarnings(value = {"rawtypes", "unchecked"})
|
||||
//public class RedisUtil2 {
|
||||
//
|
||||
// private static RedisTemplate redisTemplate;
|
||||
//
|
||||
// static {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 指定缓存失效时间
|
||||
// * @param key 键
|
||||
// * @param time 时间(秒)
|
||||
// * @return true / false
|
||||
// */
|
||||
// public static boolean expire(String key, long time) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// try {
|
||||
// if (time > 0) {
|
||||
// redisTemplate.expire(key, time, TimeUnit.SECONDS);
|
||||
// }
|
||||
// return true;
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据 key 获取过期时间
|
||||
// * @param key 键
|
||||
// */
|
||||
// public static long getExpire(String key) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// return redisTemplate.getExpire(key, TimeUnit.SECONDS);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 判断 key 是否存在
|
||||
// * @param key 键
|
||||
// * @return true / false
|
||||
// */
|
||||
// public static boolean hasKey(String key) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// try {
|
||||
// return redisTemplate.hasKey(key);
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 删除缓存
|
||||
// * @SuppressWarnings("unchecked") 忽略类型转换警告
|
||||
// * @param key 键(一个或者多个)
|
||||
// */
|
||||
// public static boolean del(String... key) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// try {
|
||||
// if (key != null && key.length > 0) {
|
||||
// if (key.length == 1) {
|
||||
// redisTemplate.delete(key[0]);
|
||||
// } else {
|
||||
//// 传入一个 Collection<String> 集合
|
||||
// redisTemplate.delete(CollectionUtils.arrayToList(key));
|
||||
// }
|
||||
// }
|
||||
// return true;
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//// ============================== String ==============================
|
||||
//
|
||||
// /**
|
||||
// * 普通缓存获取
|
||||
// * @param key 键
|
||||
// * @return 值
|
||||
// */
|
||||
// public static Object get(String key) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// return key == null ? null : redisTemplate.opsForValue().get(key);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 普通缓存放入
|
||||
// * @param key 键
|
||||
// * @param value 值
|
||||
// * @return true / false
|
||||
// */
|
||||
// public static boolean set(String key, Object value) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// try {
|
||||
// redisTemplate.opsForValue().set(key, value);
|
||||
// return true;
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 普通缓存放入并设置时间
|
||||
// * @param key 键
|
||||
// * @param value 值
|
||||
// * @param time 时间(秒),如果 time < 0 则设置无限时间
|
||||
// * @return true / false
|
||||
// */
|
||||
// public static boolean set(String key, Object value, long time) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// try {
|
||||
// if (time > 0) {
|
||||
// redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS);
|
||||
// } else {
|
||||
// set(key, value);
|
||||
// }
|
||||
// return true;
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 递增
|
||||
// * @param key 键
|
||||
// * @param delta 递增大小
|
||||
// * @return
|
||||
// */
|
||||
// public static long incr(String key, long delta) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// if (delta < 0) {
|
||||
// throw new RuntimeException("递增因子必须大于 0");
|
||||
// }
|
||||
// return redisTemplate.opsForValue().increment(key, delta);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 递减
|
||||
// * @param key 键
|
||||
// * @param delta 递减大小
|
||||
// * @return
|
||||
// */
|
||||
// public static long decr(String key, long delta) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// if (delta < 0) {
|
||||
// throw new RuntimeException("递减因子必须大于 0");
|
||||
// }
|
||||
// return redisTemplate.opsForValue().increment(key, delta);
|
||||
// }
|
||||
//
|
||||
//// ============================== Map ==============================
|
||||
//
|
||||
// /**
|
||||
// * HashGet
|
||||
// * @param key 键(no null)
|
||||
// * @param item 项(no null)
|
||||
// * @return 值
|
||||
// */
|
||||
// public static Object hget(String key, String item) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// return redisTemplate.opsForHash().get(key, item);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取 key 对应的 map
|
||||
// * @param key 键(no null)
|
||||
// * @return 对应的多个键值
|
||||
// */
|
||||
// public static Map<Object, Object> hmget(String key) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// return redisTemplate.opsForHash().entries(key);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * HashSet
|
||||
// * @param key 键
|
||||
// * @param map 值
|
||||
// * @return true / false
|
||||
// */
|
||||
// public static boolean hmset(String key, Map<Object, Object> map) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// try {
|
||||
// redisTemplate.opsForHash().putAll(key, map);
|
||||
// return true;
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * HashSet 并设置时间
|
||||
// * @param key 键
|
||||
// * @param map 值
|
||||
// * @param time 时间
|
||||
// * @return true / false
|
||||
// */
|
||||
// public static boolean hmset(String key, Map<?, ?> map, long time) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// try {
|
||||
// redisTemplate.opsForHash().putAll(key, map);
|
||||
// if (time > 0) {
|
||||
// expire(key, time);
|
||||
// }
|
||||
// return true;
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 向一张 Hash表 中放入数据,如不存在则创建
|
||||
// * @param key 键
|
||||
// * @param item 项
|
||||
// * @param value 值
|
||||
// * @return true / false
|
||||
// */
|
||||
// public static boolean hset(String key, String item, Object value) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// try {
|
||||
// redisTemplate.opsForHash().put(key, item, value);
|
||||
// return true;
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 向一张 Hash表 中放入数据,并设置时间,如不存在则创建
|
||||
// * @param key 键
|
||||
// * @param item 项
|
||||
// * @param value 值
|
||||
// * @param time 时间(如果原来的 Hash表 设置了时间,这里会覆盖)
|
||||
// * @return true / false
|
||||
// */
|
||||
// public static boolean hset(String key, String item, Object value, long time) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// try {
|
||||
// redisTemplate.opsForHash().put(key, item, value);
|
||||
// if (time > 0) {
|
||||
// expire(key, time);
|
||||
// }
|
||||
// return true;
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 删除 Hash表 中的值
|
||||
// * @param key 键
|
||||
// * @param item 项(可以多个,no null)
|
||||
// */
|
||||
// public static void hdel(String key, Object... item) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// redisTemplate.opsForHash().delete(key, item);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 判断 Hash表 中是否有该键的值
|
||||
// * @param key 键(no null)
|
||||
// * @param item 值(no null)
|
||||
// * @return true / false
|
||||
// */
|
||||
// public static boolean hHasKey(String key, String item) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// return redisTemplate.opsForHash().hasKey(key, item);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Hash递增,如果不存在则创建一个,并把新增的值返回
|
||||
// * @param key 键
|
||||
// * @param item 项
|
||||
// * @param by 递增大小 > 0
|
||||
// * @return
|
||||
// */
|
||||
// public static Double hincr(String key, String item, Double by) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// return redisTemplate.opsForHash().increment(key, item, by);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * Hash递减
|
||||
// * @param key 键
|
||||
// * @param item 项
|
||||
// * @param by 递减大小
|
||||
// * @return
|
||||
// */
|
||||
// public static Double hdecr(String key, String item, Double by) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// return redisTemplate.opsForHash().increment(key, item, -by);
|
||||
// }
|
||||
//
|
||||
//// ============================== Set ==============================
|
||||
//
|
||||
// /**
|
||||
// * 根据 key 获取 set 中的所有值
|
||||
// * @param key 键
|
||||
// * @return 值
|
||||
// */
|
||||
// public static Set<Object> sGet(String key) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// try {
|
||||
// return redisTemplate.opsForSet().members(key);
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 从键为 key 的 set 中,根据 value 查询是否存在
|
||||
// * @param key 键
|
||||
// * @param value 值
|
||||
// * @return true / false
|
||||
// */
|
||||
// public static boolean sHasKey(String key, Object value) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// try {
|
||||
// return redisTemplate.opsForSet().isMember(key, value);
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 将数据放入 set缓存
|
||||
// * @param key 键值
|
||||
// * @param values 值(可以多个)
|
||||
// * @return 成功个数
|
||||
// */
|
||||
// public static long sSet(String key, Object... values) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// try {
|
||||
// return redisTemplate.opsForSet().add(key, values);
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// return 0;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 将数据放入 set缓存,并设置时间
|
||||
// * @param key 键
|
||||
// * @param time 时间
|
||||
// * @param values 值(可以多个)
|
||||
// * @return 成功放入个数
|
||||
// */
|
||||
// public static long sSet(String key, long time, Object... values) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// try {
|
||||
// long count = redisTemplate.opsForSet().add(key, values);
|
||||
// if (time > 0) {
|
||||
// expire(key, time);
|
||||
// }
|
||||
// return count;
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// return 0;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取 set缓存的长度
|
||||
// * @param key 键
|
||||
// * @return 长度
|
||||
// */
|
||||
// public static long sGetSetSize(String key) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// try {
|
||||
// return redisTemplate.opsForSet().size(key);
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// return 0;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 移除 set缓存中,值为 value 的
|
||||
// * @param key 键
|
||||
// * @param values 值
|
||||
// * @return 成功移除个数
|
||||
// */
|
||||
// public static long setRemove(String key, Object... values) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// try {
|
||||
// return redisTemplate.opsForSet().remove(key, values);
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// return 0;
|
||||
// }
|
||||
// }
|
||||
//// ============================== ZSet ==============================
|
||||
//
|
||||
// /**
|
||||
// * 添加一个元素, zset与set最大的区别就是每个元素都有一个score,因此有个排序的辅助功能; zadd
|
||||
// *
|
||||
// * @param key
|
||||
// * @param value
|
||||
// * @param score
|
||||
// */
|
||||
// public static void zAdd(Object key, Object value, double score) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// redisTemplate.opsForZSet().add(key, value, score);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 删除元素 zrem
|
||||
// *
|
||||
// * @param key
|
||||
// * @param value
|
||||
// */
|
||||
// public static void zRemove(Object key, Object value) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// redisTemplate.opsForZSet().remove(key, value);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * score的增加or减少 zincrby
|
||||
// *
|
||||
// * @param key
|
||||
// * @param value
|
||||
// * @param delta -1 表示减 1 表示加1
|
||||
// */
|
||||
// public static Double zIncrScore(Object key, Object value, double delta) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// return redisTemplate.opsForZSet().incrementScore(key, value, delta);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 查询value对应的score zscore
|
||||
// *
|
||||
// * @param key
|
||||
// * @param value
|
||||
// * @return
|
||||
// */
|
||||
// public static Double zScore(Object key, Object value) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// return redisTemplate.opsForZSet().score(key, value);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 判断value在zset中的排名 zrank
|
||||
// *
|
||||
// * @param key
|
||||
// * @param value
|
||||
// * @return
|
||||
// */
|
||||
// public static Long zRank(Object key, Object value) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// return redisTemplate.opsForZSet().rank(key, value);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 返回集合的长度
|
||||
// *
|
||||
// * @param key
|
||||
// * @return
|
||||
// */
|
||||
// public static Long zSize(Object key) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// return redisTemplate.opsForZSet().zCard(key);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 查询集合中指定顺序的值, 0 -1 表示获取全部的集合内容 zrange
|
||||
// *
|
||||
// * 返回有序的集合,score小的在前面
|
||||
// *
|
||||
// * @param key
|
||||
// * @param start
|
||||
// * @param end
|
||||
// * @return
|
||||
// */
|
||||
// public static Set<Object> zRange(Object key, int start, int end) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// return redisTemplate.opsForZSet().range(key, start, end);
|
||||
// }
|
||||
// /**
|
||||
// * 查询集合中指定顺序的值和score,0, -1 表示获取全部的集合内容
|
||||
// *
|
||||
// * @param key
|
||||
// * @param start
|
||||
// * @param end
|
||||
// * @return
|
||||
// */
|
||||
// public static Set<ZSetOperations.TypedTuple<String>> zRangeWithScore(Object key, int start, int end) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// return redisTemplate.opsForZSet().rangeWithScores(key, start, end);
|
||||
// }
|
||||
// /**
|
||||
// * 查询集合中指定顺序的值 zrevrange
|
||||
// *
|
||||
// * 返回有序的集合中,score大的在前面
|
||||
// *
|
||||
// * @param key
|
||||
// * @param start
|
||||
// * @param end
|
||||
// * @return
|
||||
// */
|
||||
// public static Set<String> zRevRange(Object key, int start, int end) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// return redisTemplate.opsForZSet().reverseRange(key, start, end);
|
||||
// }
|
||||
// /**
|
||||
// * 根据score的值,来获取满足条件的集合 zrangebyscore
|
||||
// *
|
||||
// * @param key
|
||||
// * @param min
|
||||
// * @param max
|
||||
// * @return
|
||||
// */
|
||||
// public static Set<String> zSortRange(Object key, int min, int max) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// return redisTemplate.opsForZSet().rangeByScore(key, min, max);
|
||||
// }
|
||||
//
|
||||
//
|
||||
//// ============================== List ==============================
|
||||
//
|
||||
// /**
|
||||
// * 获取 list缓存的内容
|
||||
// * @param key 键
|
||||
// * @param start 开始
|
||||
// * @param end 结束(0 到 -1 代表所有值)
|
||||
// * @return
|
||||
// */
|
||||
// public static List<Object> lGet(String key, long start, long end) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// try {
|
||||
// return redisTemplate.opsForList().range(key, start, end);
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取 list缓存的长度
|
||||
// * @param key 键
|
||||
// * @return 长度
|
||||
// */
|
||||
// public static long lGetListSize(String key) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// try {
|
||||
// return redisTemplate.opsForList().size(key);
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// return 0;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据索引 index 获取键为 key 的 list 中的元素
|
||||
// * @param key 键
|
||||
// * @param index 索引
|
||||
// * 当 index >= 0 时 {0:表头, 1:第二个元素}
|
||||
// * 当 index < 0 时 {-1:表尾, -2:倒数第二个元素}
|
||||
// * @return 值
|
||||
// */
|
||||
// public static Object lGetIndex(String key, long index) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// try {
|
||||
// return redisTemplate.opsForList().index(key, index);
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 将值 value 插入键为 key 的 list 中,如果 list 不存在则创建空 list
|
||||
// * @param key 键
|
||||
// * @param value 值
|
||||
// * @return true / false
|
||||
// */
|
||||
// public static boolean lSet(String key, Object value) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// try {
|
||||
// redisTemplate.opsForList().rightPush(key, value);
|
||||
// return true;
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 将值 value 插入键为 key 的 list 中,并设置时间
|
||||
// * @param key 键
|
||||
// * @param value 值
|
||||
// * @param time 时间
|
||||
// * @return true / false
|
||||
// */
|
||||
// public static boolean lSet(String key, Object value, long time) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// try {
|
||||
// redisTemplate.opsForList().rightPush(key, value);
|
||||
// if (time > 0) {
|
||||
// expire(key, time);
|
||||
// }
|
||||
// return true;
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 将 values 插入键为 key 的 list 中
|
||||
// * @param key 键
|
||||
// * @param values 值
|
||||
// * @return true / false
|
||||
// */
|
||||
// public static boolean lSetList(String key, List<Object> values) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// try {
|
||||
// redisTemplate.opsForList().rightPushAll(key, values);
|
||||
// return true;
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 将 values 插入键为 key 的 list 中,并设置时间
|
||||
// * @param key 键
|
||||
// * @param values 值
|
||||
// * @param time 时间
|
||||
// * @return true / false
|
||||
// */
|
||||
// public static boolean lSetList(String key, List<Object> values, long time) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// try {
|
||||
// redisTemplate.opsForList().rightPushAll(key, values);
|
||||
// if (time > 0) {
|
||||
// expire(key, time);
|
||||
// }
|
||||
// return true;
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据索引 index 修改键为 key 的值
|
||||
// * @param key 键
|
||||
// * @param index 索引
|
||||
// * @param value 值
|
||||
// * @return true / false
|
||||
// */
|
||||
// public static boolean lUpdateIndex(String key, long index, Object value) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// try {
|
||||
// redisTemplate.opsForList().set(key, index, value);
|
||||
// return true;
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 在键为 key 的 list 中删除值为 value 的元素
|
||||
// * @param key 键
|
||||
// * @param count 如果 count == 0 则删除 list 中所有值为 value 的元素
|
||||
// * 如果 count > 0 则删除 list 中最左边那个值为 value 的元素
|
||||
// * 如果 count < 0 则删除 list 中最右边那个值为 value 的元素
|
||||
// * @param value
|
||||
// * @return
|
||||
// */
|
||||
// public static long lRemove(String key, long count, Object value) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// try {
|
||||
// return redisTemplate.opsForList().remove(key, count, value);
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// return 0;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 在键为 key 的 list中移除第一个元素
|
||||
// * @param key 键
|
||||
// * @return
|
||||
// */
|
||||
// public static Object lLeftPop(String key) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// return redisTemplate.opsForList().leftPop(key);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 在键为 key 的 list中移除、最后一个元素
|
||||
// * @param key 键
|
||||
// * @return
|
||||
// */
|
||||
// public static Object lrightPop(String key) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// return redisTemplate.opsForList().rightPop(key);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 模糊查询
|
||||
// * @param key 键
|
||||
// * @return true / false
|
||||
// */
|
||||
// public static List<Object> keys(String key) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// try {
|
||||
// Set<String> set = redisTemplate.keys(key);
|
||||
// return new ArrayList<>(set);
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 模糊查询
|
||||
// * @param query 查询参数
|
||||
// * @return
|
||||
// */
|
||||
//// public static List<Object> scan(String query) {
|
||||
//// List<Object> result = new ArrayList<>();
|
||||
//// try {
|
||||
//// Cursor<Map.Entry<Object,Object>> cursor = redisTemplate.opsForHash().scan("field",
|
||||
//// ScanOptions.scanOptions().match(query).count(1000).build());
|
||||
//// while (cursor.hasNext()) {
|
||||
//// Map.Entry<Object,Object> entry = cursor.next();
|
||||
//// result.add(entry.getKey());
|
||||
//// Object key = entry.getKey();
|
||||
//// Object valueSet = entry.getValue();
|
||||
//// }
|
||||
//// //关闭cursor
|
||||
//// cursor.close();
|
||||
//// } catch (Exception e) {
|
||||
//// e.printStackTrace();
|
||||
//// }
|
||||
//// return result;
|
||||
//// }
|
||||
//
|
||||
// /**
|
||||
// * 模糊查询
|
||||
// * @param query 查询参数
|
||||
// * @return
|
||||
// */
|
||||
// public static List<Object> scan(String query) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// Set<String> resultKeys = (Set<String>) redisTemplate.execute((RedisCallback<Set<String>>) connection -> {
|
||||
// ScanOptions scanOptions = ScanOptions.scanOptions().match("*" + query + "*").count(1000).build();
|
||||
// Cursor<byte[]> scan = connection.scan(scanOptions);
|
||||
// Set<String> keys = new HashSet<>();
|
||||
// while (scan.hasNext()) {
|
||||
// byte[] next = scan.next();
|
||||
// keys.add(new String(next));
|
||||
// }
|
||||
// return keys;
|
||||
// });
|
||||
//
|
||||
// return new ArrayList<>(resultKeys);
|
||||
// }
|
||||
// public static List<Object> scan2(String query) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// Set<String> keys = redisTemplate.keys(query);
|
||||
// return new ArrayList<>(keys);
|
||||
// }
|
||||
// // ============================== 消息发送与订阅 ==============================
|
||||
// public static void convertAndSend(String channel, JSONObject msg) {
|
||||
// if (redisTemplate == null) {
|
||||
// redisTemplate = SpringBeanFactory.getBean("redisTemplate");
|
||||
// }
|
||||
// redisTemplate.convertAndSend(channel, msg);
|
||||
// }
|
||||
//
|
||||
//}
|
||||
+2
-2
@@ -154,7 +154,7 @@ public class PlatformController {
|
||||
if (ObjectUtils.isEmpty(parentPlatform.getName())
|
||||
|| ObjectUtils.isEmpty(parentPlatform.getServerGBId())
|
||||
|| ObjectUtils.isEmpty(parentPlatform.getServerGBDomain())
|
||||
|| ObjectUtils.isEmpty(parentPlatform.getServerIP())
|
||||
|| ObjectUtils.isEmpty(parentPlatform.getServerIp())
|
||||
|| ObjectUtils.isEmpty(parentPlatform.getServerPort())
|
||||
|| ObjectUtils.isEmpty(parentPlatform.getDeviceGBId())
|
||||
|| ObjectUtils.isEmpty(parentPlatform.getExpires())
|
||||
@@ -199,7 +199,7 @@ public class PlatformController {
|
||||
if (ObjectUtils.isEmpty(parentPlatform.getName())
|
||||
|| ObjectUtils.isEmpty(parentPlatform.getServerGBId())
|
||||
|| ObjectUtils.isEmpty(parentPlatform.getServerGBDomain())
|
||||
|| ObjectUtils.isEmpty(parentPlatform.getServerIP())
|
||||
|| ObjectUtils.isEmpty(parentPlatform.getServerIp())
|
||||
|| ObjectUtils.isEmpty(parentPlatform.getServerPort())
|
||||
|| ObjectUtils.isEmpty(parentPlatform.getDeviceGBId())
|
||||
|| ObjectUtils.isEmpty(parentPlatform.getExpires())
|
||||
|
||||
+9
@@ -1,11 +1,14 @@
|
||||
package com.genersoft.iot.vmp.vmanager.gb28181.platform.bean;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* 精简的channel信息展示,主要是选择通道的时候展示列表使用
|
||||
*/
|
||||
@TableName("wvp_platform_gb_channel")
|
||||
@Schema(description = "精简的channel信息展示")
|
||||
public class ChannelReduce {
|
||||
|
||||
@@ -18,36 +21,42 @@ public class ChannelReduce {
|
||||
/**
|
||||
* 通道id
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "通道国标编号")
|
||||
private String channelId;
|
||||
|
||||
/**
|
||||
* 设备id
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "设备国标编号")
|
||||
private String deviceId;
|
||||
|
||||
/**
|
||||
* 通道名
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "通道名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 生产厂商
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "生产厂商")
|
||||
private String manufacturer;
|
||||
|
||||
/**
|
||||
* wan地址
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "wan地址")
|
||||
private String hostAddress;
|
||||
|
||||
/**
|
||||
* 子节点数
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "子节点数")
|
||||
private int subCount;
|
||||
|
||||
|
||||
-51
@@ -1,51 +0,0 @@
|
||||
//package com.genersoft.iot.vmp.vmanager.record;
|
||||
//
|
||||
//import com.alibaba.fastjson2.JSONObject;
|
||||
//import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
|
||||
//import com.genersoft.iot.vmp.service.IRecordInfoServer;
|
||||
//import com.genersoft.iot.vmp.storager.dao.dto.RecordInfo;
|
||||
//import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
|
||||
//import com.github.pagehelper.PageInfo;
|
||||
//import io.swagger.annotations.Api;
|
||||
//import io.swagger.annotations.ApiImplicitParam;
|
||||
//import io.swagger.annotations.ApiImplicitParams;
|
||||
//import io.swagger.annotations.ApiOperation;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.web.bind.annotation.*;
|
||||
//
|
||||
//@Tag(name = "云端录像")
|
||||
//
|
||||
//@RestController
|
||||
//@RequestMapping("/api/record")
|
||||
//public class RecordController {
|
||||
//
|
||||
// @Autowired
|
||||
// private IRecordInfoServer recordInfoServer;
|
||||
//
|
||||
// //@ApiOperation("录像列表查询")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name="page", value = "当前页", required = true, dataTypeClass = Integer.class),
|
||||
// @ApiImplicitParam(name="count", value = "每页查询数量", required = true, dataTypeClass = Integer.class),
|
||||
// @ApiImplicitParam(name="query", value = "查询内容", dataTypeClass = String.class),
|
||||
// })
|
||||
// @GetMapping(value = "/app/list")
|
||||
// @ResponseBody
|
||||
// public Object list(@RequestParam(required = false)Integer page,
|
||||
// @RequestParam(required = false)Integer count ){
|
||||
//
|
||||
// PageInfo<RecordInfo> recordList = recordInfoServer.getRecordList(page - 1, page - 1 + count);
|
||||
// return recordList;
|
||||
// }
|
||||
//
|
||||
// //@ApiOperation("获取录像详情")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name="recordInfo", value = "录像记录", required = true, dataTypeClass = RecordInfo.class)
|
||||
// })
|
||||
// @GetMapping(value = "/detail")
|
||||
// @ResponseBody
|
||||
// public JSONObject list(RecordInfo recordInfo, String time ){
|
||||
//
|
||||
//
|
||||
// return null;
|
||||
// }
|
||||
//}
|
||||
+1
@@ -0,0 +1 @@
|
||||
com.genersoft.iot.vmp.GbSipAutoConfiguration
|
||||
-51
@@ -1,54 +1,6 @@
|
||||
spring:
|
||||
# 设置接口超时时间
|
||||
mvc:
|
||||
async:
|
||||
request-timeout: 20000
|
||||
thymeleaf:
|
||||
cache: false
|
||||
# [可选]上传文件大小限制
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 10MB
|
||||
max-request-size: 100MB
|
||||
# REDIS数据库配置
|
||||
redis:
|
||||
# [必须修改] Redis服务器IP, REDIS安装在本机的,使用127.0.0.1
|
||||
host: 127.0.0.1
|
||||
# [必须修改] 端口号
|
||||
port: 6379
|
||||
# [可选] 数据库 DB
|
||||
database: 7
|
||||
# [可选] 访问密码,若你的redis服务器没有设置密码,就不需要用密码去连接
|
||||
password: luna
|
||||
# [可选] 超时时间
|
||||
timeout: 10000
|
||||
# mysql数据源
|
||||
datasource:
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/wvp?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&serverTimezone=PRC&useSSL=false&allowMultiQueries=true
|
||||
username: root
|
||||
password: 123456
|
||||
hikari:
|
||||
connection-timeout: 20000 # 是客户端等待连接池连接的最大毫秒数
|
||||
initialSize: 10 # 连接池初始化连接数
|
||||
maximum-pool-size: 200 # 连接池最大连接数
|
||||
minimum-idle: 5 # 连接池最小空闲连接数
|
||||
idle-timeout: 300000 # 允许连接在连接池中空闲的最长时间(以毫秒为单位)
|
||||
max-lifetime: 1200000 # 是池中连接关闭后的最长生命周期(以毫秒为单位)
|
||||
#[可选] WVP监听的HTTP端口, 网页和接口调用都是这个端口
|
||||
server:
|
||||
port: 8080
|
||||
# [可选] HTTPS配置, 默认不开启
|
||||
ssl:
|
||||
# [可选] 是否开启HTTPS访问
|
||||
enabled: false
|
||||
# [可选] 证书文件路径,放置在resource/目录下即可,修改xxx为文件名
|
||||
key-store: classpath:test.monitor.89iot.cn.jks
|
||||
# [可选] 证书密码
|
||||
key-store-password: gpf64qmw
|
||||
# [可选] 证书类型, 默认为jks,根据实际修改
|
||||
key-store-type: JKS
|
||||
|
||||
# 作为28181服务器的配置
|
||||
sip:
|
||||
@@ -110,6 +62,3 @@ user-settings:
|
||||
allowed-origins:
|
||||
- http://localhost:8080
|
||||
- http://127.0.0.1:8080
|
||||
logging:
|
||||
level:
|
||||
root: info
|
||||
@@ -1,5 +0,0 @@
|
||||
spring:
|
||||
application:
|
||||
name: wvp
|
||||
profiles:
|
||||
active: dev
|
||||
@@ -1,7 +0,0 @@
|
||||
___ __ ___ ___ ________ ________ ________ ________
|
||||
|\ \ |\ \|\ \ / /|\ __ \ |\ __ \|\ __ \|\ __ \
|
||||
\ \ \ \ \ \ \ \ / / | \ \|\ \ ____________\ \ \|\ \ \ \|\ \ \ \|\ \
|
||||
\ \ \ __\ \ \ \ \/ / / \ \ ____\\____________\ \ ____\ \ _ _\ \ \\\ \
|
||||
\ \ \|\__\_\ \ \ / / \ \ \___\|____________|\ \ \___|\ \ \\ \\ \ \\\ \
|
||||
\ \____________\ \__/ / \ \__\ \ \__\ \ \__\\ _\\ \_______\
|
||||
\|____________|\|__|/ \|__| \|__| \|__|\|__|\|_______|
|
||||
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.genersoft.iot.vmp.storager.dao.DeviceAlarmMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BasicMap" type="com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm">
|
||||
<result column="id" property="id" />
|
||||
<result column="longitude" property="longitude" />
|
||||
<result column="latitude" property="latitude" />
|
||||
<result column="alarm_type" property="alarmType" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="device_id" property="deviceId" />
|
||||
<result column="channel_id" property="channelId" />
|
||||
<result column="alarm_time" property="alarmTime" />
|
||||
<result column="alarm_method" property="alarmMethod" />
|
||||
<result column="alarm_priority" property="alarmPriority" />
|
||||
<result column="alarm_description" property="alarmDescription" />
|
||||
</resultMap>
|
||||
<delete id="clearAlarmBeforeTime">
|
||||
DELETE FROM wvp_device_alarm
|
||||
<where>
|
||||
<if test="deviceIdList != null and id == null " > AND device_id in
|
||||
<foreach collection='deviceIdList' item='item' open='(' separator=',' close=')' > #{item}</foreach>
|
||||
</if>
|
||||
<if test="time != null and id == null " > AND alarm_time <= #{time}</if>
|
||||
<if test="id != null" > AND id = #{id}</if>
|
||||
</where>
|
||||
</delete>
|
||||
|
||||
<select id="query" resultType="com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm">
|
||||
SELECT * FROM wvp_device_alarm
|
||||
<where>
|
||||
<if test="deviceId != null" > AND device_id = #{deviceId}</if>
|
||||
<if test="alarmPriority != null" > AND alarm_priority = #{alarmPriority} </if>
|
||||
<if test="alarmMethod != null" > AND alarm_method = #{alarmMethod} </if>
|
||||
<if test="alarmType != null" > AND alarm_type = #{alarmType} </if>
|
||||
<if test="startTime != null" > AND alarm_time >= #{startTime} </if>
|
||||
<if test="endTime != null" > AND alarm_time <= #{endTime} </if>
|
||||
</where>
|
||||
ORDER BY alarm_time ASC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.genersoft.iot.vmp.storager.dao.PlatformCatalogMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BasicMap" type="com.genersoft.iot.vmp.gb28181.bean.PlatformCatalog">
|
||||
<result column="id" property="id" />
|
||||
<result column="name" property="name" />
|
||||
<result column="type" property="type" />
|
||||
<result column="parent_id" property="parentId" />
|
||||
<result column="civil_code" property="civilCode" />
|
||||
<result column="platform_id" property="platformId" />
|
||||
<result column="children_count" property="childrenCount" />
|
||||
<result column="business_group_id" property="businessGroupId" />
|
||||
</resultMap>
|
||||
|
||||
<delete id="del">
|
||||
DELETE from wvp_platform_catalog WHERE platform_id=#{platformId} and id=#{id}
|
||||
</delete>
|
||||
|
||||
<delete id="delByPlatformId">
|
||||
DELETE from wvp_platform_catalog WHERE platform_id=#{platformId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAll">
|
||||
DELETE from wvp_platform_catalog where platform_id=#{platformId} and id in
|
||||
<foreach collection='ids' item='item' open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectByParentId" resultType="com.genersoft.iot.vmp.gb28181.bean.PlatformCatalog">
|
||||
SELECT pc.*, count(pc2.id) as children_count from wvp_platform_catalog pc
|
||||
left join wvp_platform_catalog pc2 on pc.id = pc2.parent_id
|
||||
WHERE pc.parent_id=#{parentId} AND pc.platform_id=#{platformId}
|
||||
group by pc.id, pc.name, pc.platform_id, pc.business_group_id, pc.civil_code, pc.parent_id
|
||||
</select>
|
||||
|
||||
<select id="selectByPlatForm" resultType="com.genersoft.iot.vmp.gb28181.bean.PlatformCatalog">
|
||||
SELECT *, (SELECT COUNT(1) from wvp_platform_catalog where parent_id = pc.id) as children_count from wvp_platform_catalog pc WHERE pc.platform_id=#{platformId}
|
||||
</select>
|
||||
|
||||
<select id="selectDefaultByPlatFormId" resultType="com.genersoft.iot.vmp.gb28181.bean.PlatformCatalog">
|
||||
SELECT pc.* FROM wvp_platform_catalog pc WHERE pc.id = (SELECT pp.catalog_id from wvp_platform pp WHERE pp.server_gb_id=#{platformId})
|
||||
</select>
|
||||
|
||||
<select id="queryCatalogInPlatform" resultType="com.genersoft.iot.vmp.gb28181.bean.DeviceChannel">
|
||||
SELECT pc.id as channel_id, pc.name, pc.civil_code, pc.business_group_id,'1' as parental, pc.parent_id from wvp_platform_catalog pc WHERE pc.platform_id=#{platformId}
|
||||
</select>
|
||||
|
||||
<select id="selectByPlatFormAndCatalogId" resultType="com.genersoft.iot.vmp.gb28181.bean.PlatformCatalog">
|
||||
SELECT *, (SELECT COUNT(1) from wvp_platform_catalog where parent_id = pc.id) as children_count from wvp_platform_catalog pc
|
||||
WHERE pc.id=#{id} and pc.platform_id=#{platformId}
|
||||
</select>
|
||||
<select id="queryCatalogFromParent" resultType="java.lang.String">
|
||||
SELECT id from wvp_platform_catalog WHERE platform_id=#{platformId} and parent_id = #{id}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,112 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.genersoft.iot.vmp.storager.dao.PlatformChannelMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BasicMap" type="com.genersoft.iot.vmp.vmanager.gb28181.platform.bean.ChannelReduce">
|
||||
<result column="id" property="id" />
|
||||
<result column="name" property="name" />
|
||||
<result column="sub_count" property="subCount" />
|
||||
<result column="manufacturer" property="manufacturer" />
|
||||
<result column="device_id" property="deviceId" />
|
||||
<result column="catalog_id" property="catalogId" />
|
||||
<result column="channel_id" property="channelId" />
|
||||
<result column="platform_id" property="platformId" />
|
||||
<result column="host_address" property="hostAddress" />
|
||||
</resultMap>
|
||||
<insert id="addChannels">
|
||||
INSERT INTO wvp_platform_gb_channel (platform_id, device_channel_id, catalog_id) VALUES
|
||||
<foreach collection='channelReducesToAdd' item='item' separator=','>
|
||||
(#{platformId}, #{item.id} , #{item.catalogId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="delChannelForGB">
|
||||
DELETE from wvp_platform_gb_channel WHERE platform_id=#{platformId} AND device_channel_id in
|
||||
<foreach collection='channelReducesToDel' item='item' open='(' separator=',' close=')' > #{item.id}</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="delChannelForDeviceId">
|
||||
DELETE from wvp_platform_gb_channel WHERE device_channel_id in
|
||||
( select temp.device_channel_id from
|
||||
(select pgc.device_channel_id from wvp_platform_gb_channel pgc
|
||||
left join wvp_device_channel dc on dc.id = pgc.device_channel_id where dc.device_id =#{deviceId}
|
||||
) temp)
|
||||
</delete>
|
||||
|
||||
<delete id="cleanChannelForGB">
|
||||
DELETE from wvp_platform_gb_channel WHERE platform_id=#{platformId}
|
||||
</delete>
|
||||
|
||||
<delete id="delByCatalogId">
|
||||
DELETE from wvp_platform_gb_channel WHERE platform_id=#{platformId} and catalog_id=#{id}
|
||||
</delete>
|
||||
|
||||
<delete id="delByCatalogIdAndChannelIdAndPlatformId">
|
||||
DELETE from wvp_platform_gb_channel WHERE catalog_id=#{parentId} AND platform_id=#{platformId} AND channel_id=#{id}
|
||||
</delete>
|
||||
|
||||
<delete id="delByPlatformId">
|
||||
DELETE from wvp_platform_gb_channel WHERE platform_id=#{serverGBId}
|
||||
</delete>
|
||||
|
||||
<delete id="delChannelForGBByCatalogId">
|
||||
DELETE from wvp_platform_gb_channel WHERE platform_id=#{platformId}
|
||||
<if test="catalogId != null" > and catalog_id=#{catalogId}</if>
|
||||
</delete>
|
||||
|
||||
<select id="findChannelRelatedPlatform" resultType="java.lang.Integer">
|
||||
SELECT device_channel_id from wvp_platform_gb_channel
|
||||
WHERE platform_id=#{platformId} AND device_channel_id in
|
||||
<foreach collection='channelReduces' open='(' item='item' separator=',' close=')'> #{item.id}</foreach>
|
||||
</select>
|
||||
|
||||
<select id="queryChannelInParentPlatform" resultType="com.genersoft.iot.vmp.gb28181.bean.DeviceChannel">
|
||||
SELECT dc.* from wvp_platform_gb_channel pgc
|
||||
left join wvp_device_channel dc on dc.id = pgc.device_channel_id
|
||||
WHERE dc.channel_id=#{channelId} and pgc.platform_id=#{platformId}
|
||||
</select>
|
||||
|
||||
<select id="queryAllChannelInCatalog" resultType="com.genersoft.iot.vmp.gb28181.bean.DeviceChannel">
|
||||
SELECT dc.* from wvp_platform_gb_channel pgc
|
||||
left join wvp_device_channel dc on dc.id = pgc.device_channel_id
|
||||
WHERE pgc.platform_id=#{platformId} and pgc.catalog_id=#{catalogId}
|
||||
</select>
|
||||
<select id="queryChannelInParentPlatformAndCatalog"
|
||||
resultType="com.genersoft.iot.vmp.gb28181.bean.PlatformCatalog">
|
||||
select dc.channel_id as id, dc.name as name, pgc.platform_id as platform_id, pgc.catalog_id as parent_id, 0 as children_count, 1 as type
|
||||
from wvp_device_channel dc left join wvp_platform_gb_channel pgc on dc.id = pgc.device_channel_id
|
||||
where pgc.platform_id=#{platformId} and pgc.catalog_id=#{catalogId}
|
||||
</select>
|
||||
|
||||
<select id="queryVideoDeviceByPlatformIdAndChannelId"
|
||||
resultType="com.genersoft.iot.vmp.gb28181.bean.Device">
|
||||
select d.* from wvp_platform_gb_channel pgc
|
||||
left join wvp_device_channel dc on dc.id = pgc.device_channel_id
|
||||
left join wvp_device d on dc.device_id = d.device_id
|
||||
where dc.channel_id = #{channelId} and pgc.platform_id=#{platformId}
|
||||
</select>
|
||||
|
||||
<select id="queryPlatFormListForGBWithGBId" resultType="com.genersoft.iot.vmp.gb28181.bean.ParentPlatform">
|
||||
SELECT pp.* FROM wvp_platform pp
|
||||
left join wvp_platform_gb_channel pgc on pp.server_gb_id = pgc.platform_id
|
||||
left join wvp_device_channel dc on dc.id = pgc.device_channel_id
|
||||
WHERE dc.channel_id = #{channelId} and pp.status = true AND pp.server_gb_id IN
|
||||
<foreach collection='platforms' item='item' open='(' separator=',' close=')' > #{item}</foreach>
|
||||
</select>
|
||||
<select id="queryDeviceInfoByPlatformIdAndChannelId"
|
||||
resultType="com.genersoft.iot.vmp.gb28181.bean.Device">
|
||||
select dc.channel_id, dc.device_id, dc.name, d.manufacturer, d.model, d.firmware
|
||||
from wvp_platform_gb_channel pgc
|
||||
left join wvp_device_channel dc on dc.id = pgc.device_channel_id
|
||||
left join wvp_device d on dc.device_id = d.device_id
|
||||
where dc.channel_id = #{channelId} and pgc.platform_id=#{platformId}
|
||||
</select>
|
||||
|
||||
<select id="queryParentPlatformByChannelId" resultType="java.lang.String">
|
||||
SELECT pgc.platform_id from wvp_platform_gb_channel pgc
|
||||
left join wvp_device_channel dc on dc.id = pgc.device_channel_id
|
||||
WHERE dc.channel_id = ${channelId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,81 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.genersoft.iot.vmp.storager.dao.PlatformGbStreamMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BasicMap" type="com.genersoft.iot.vmp.gb28181.bean.PlatformGbStream">
|
||||
<result column="platform_id" property="platformId" />
|
||||
<result column="catalog_id" property="catalogId" />
|
||||
<result column="gb_stream_id" property="gbStreamId" />
|
||||
</resultMap>
|
||||
|
||||
<insert id="batchAdd">
|
||||
INSERT into wvp_platform_gb_stream (gb_stream_id, platform_id, catalog_id) values
|
||||
<foreach collection='streamPushItems' index='index' item='item' separator=','>
|
||||
(#{item.gbStreamId}, #{item.platform_id}, #{item.catalogId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="delByAppAndStream">
|
||||
DELETE from wvp_platform_gb_stream WHERE gb_stream_id = (select gb_stream_id from wvp_gb_stream where app=#{app} AND stream=#{stream})
|
||||
</delete>
|
||||
|
||||
<delete id="delByPlatformId">
|
||||
DELETE from wvp_platform_gb_stream WHERE platform_id=#{platformId}
|
||||
</delete>
|
||||
|
||||
<delete id="delByGbStreams">
|
||||
DELETE from wvp_platform_gb_stream where gb_stream_id in
|
||||
<foreach collection='gbStreams' item='item' open='(' separator=',' close=')' >
|
||||
#{item.gbStreamId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="delByAppAndStreamsByPlatformId">
|
||||
DELETE from wvp_platform_gb_stream where platform_id=#{platformId} and gb_stream_id in
|
||||
<foreach collection='gbStreams' item='item' open='(' separator=',' close=')'>
|
||||
#{item.gbStreamId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="delByPlatformAndCatalogId">
|
||||
DELETE from wvp_platform_gb_stream WHERE platform_id=#{platformId} and catalog_id=#{catalogId}
|
||||
</delete>
|
||||
|
||||
<select id="selectByAppAndStream" resultType="com.genersoft.iot.vmp.gb28181.bean.ParentPlatform">
|
||||
SELECT pp.* FROM wvp_platform_gb_stream pgs
|
||||
LEFT JOIN wvp_platform pp ON pp.server_gb_id = pgs.platform_id
|
||||
LEFT join wvp_gb_stream gs ON gs.gb_stream_id = pgs.gb_stream_id
|
||||
WHERE gs.app =#{app} AND gs.stream =#{stream}
|
||||
</select>
|
||||
|
||||
<select id="selectOne" resultType="com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem">
|
||||
SELECT pgs.*, gs.gb_id from wvp_platform_gb_stream pgs
|
||||
LEFT join wvp_gb_stream gs ON pgs.gb_stream_id = gs.gb_stream_id
|
||||
WHERE gs.app=#{app} AND gs.stream=#{stream} AND pgs.platform_id=#{platformId}
|
||||
</select>
|
||||
|
||||
<select id="queryChannelInParentPlatformAndCatalog"
|
||||
resultType="com.genersoft.iot.vmp.gb28181.bean.GbStream">
|
||||
select gs.* from wvp_gb_stream gs
|
||||
left join wvp_platform_gb_stream pgs on gs.gb_stream_id = pgs.gb_stream_id
|
||||
where pgs.platform_id=#{platformId} and pgs.catalog_id=#{catalogId}
|
||||
</select>
|
||||
|
||||
<select id="queryChannelInParentPlatformAndCatalogForCatalog"
|
||||
resultType="com.genersoft.iot.vmp.gb28181.bean.PlatformCatalog">
|
||||
select gs.gb_id as id, gs.name as name, pgs.platform_id as platform_id, pgs.catalog_id as catalog_id , 0 as children_count, 2 as type from wvp_gb_stream gs
|
||||
left join wvp_platform_gb_stream pgs on gs.gb_stream_id = pgs.gb_stream_id
|
||||
where pgs.platform_id=#{platformId} and pgs.catalog_id=#{catalogId}
|
||||
</select>
|
||||
|
||||
<select id="queryPlatFormListForGBWithGBId" resultType="com.genersoft.iot.vmp.gb28181.bean.ParentPlatform">
|
||||
SELECT pp.* FROM wvp_platform pp
|
||||
left join wvp_platform_gb_stream pgs on pp.server_gb_id = pgs.platform_id
|
||||
left join wvp_gb_stream gs on gs.gb_stream_id = pgs.gb_stream_id
|
||||
WHERE gs.app = #{app} AND gs.stream = #{stream} AND pp.server_gb_id IN
|
||||
<foreach collection='platforms' item='item' open='(' separator=',' close=')' > #{item}</foreach>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -26,6 +26,17 @@
|
||||
<result column="create_time" property="createTime" />
|
||||
</resultMap>
|
||||
|
||||
<update id="updateStatusByMediaServerId">
|
||||
UPDATE wvp_stream_proxy SET status=#{status} WHERE media_server_id=#{mediaServerId}
|
||||
</update>
|
||||
|
||||
<update id="updateStatus">
|
||||
UPDATE wvp_stream_proxy SET status=#{status} WHERE app=#{app} AND stream=#{stream}
|
||||
</update>
|
||||
<delete id="deleteAutoRemoveItemByMediaServerId">
|
||||
DELETE FROM wvp_stream_proxy WHERE enable_remove_none_reader=true AND media_server_id=#{mediaServerId}
|
||||
</delete>
|
||||
|
||||
<select id="listDetailByPage" resultType="com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem">
|
||||
SELECT st.*, pgs.gb_id, pgs.name, pgs.longitude, pgs.latitude FROM wvp_stream_proxy st
|
||||
LEFT join wvp_gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream
|
||||
@@ -38,7 +49,7 @@
|
||||
WHERE st.enable=#{enable} order by st.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectOne" resultType="com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem">
|
||||
<select id="getByAppAndStream" resultType="com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem">
|
||||
SELECT st.*, pgs.gb_id, pgs.name, pgs.longitude, pgs.latitude FROM wvp_stream_proxy st
|
||||
LEFT join wvp_gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream
|
||||
WHERE st.app=#{app} AND st.stream=#{stream} order by st.create_time desc
|
||||
@@ -50,4 +61,21 @@
|
||||
WHERE st.enable=#{enable} and st.media_server_id= #{id} order by st.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectInMediaServer" resultType="com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem">
|
||||
SELECT st.*, pgs.gb_id, pgs.name, pgs.longitude, pgs.latitude FROM wvp_stream_proxy st
|
||||
LEFT join wvp_gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream
|
||||
WHERE st.media_server_id= #{id} order by st.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectAutoRemoveItemByMediaServerId"
|
||||
resultType="com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem">
|
||||
SELECT st.*, pgs.gb_id, pgs.name, pgs.longitude, pgs.latitude FROM wvp_stream_proxy st
|
||||
LEFT join wvp_gb_stream pgs on st.app = pgs.app AND st.stream = pgs.stream
|
||||
WHERE st.enable_remove_none_reader=true AND st.media_server_id=#{mediaServerId} order by st.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="getOverview" resultType="com.genersoft.iot.vmp.vmanager.bean.ResourceBaseInfo">
|
||||
select count(1) as total, sum(status) as online from wvp_stream_proxy
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
order by st.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectOne" resultMap="BasicMap">
|
||||
<select id="getByAppAndStream" resultMap="BasicMap">
|
||||
SELECT st.*, gs.gb_id, gs.name, gs.longitude, gs.latitude FROM wvp_stream_push st
|
||||
LEFT join wvp_gb_stream gs on st.app = gs.app AND st.stream = gs.stream
|
||||
WHERE st.app=#{app} AND st.stream=#{stream}
|
||||
|
||||
@@ -73,12 +73,6 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-to-slf4j</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!--其他全局类库-->
|
||||
|
||||
Reference in New Issue
Block a user