From 1de344674afd6bb35b51b165bbad76dbe6299b7e Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期四, 28 三月 2024 18:08:33 +0800 Subject: [PATCH] 使用冒号分隔redis的key --- src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java | 41 +++++++++++++++++++++++++++++++++-------- 1 files changed, 33 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java b/src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java index cd22880..884036a 100644 --- a/src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java +++ b/src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java @@ -2,11 +2,11 @@ import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; import com.genersoft.iot.vmp.utils.DateUtil; -import org.junit.jupiter.api.Order; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Configuration; +import org.springframework.core.annotation.Order; import org.springframework.util.ObjectUtils; import java.net.InetAddress; @@ -81,6 +81,12 @@ @Value("${media.record-assist-port:0}") private Integer recordAssistPort = 0; + @Value("${media.record-day:7}") + private Integer recordDay; + + @Value("${media.record-path:}") + private String recordPath; + public String getId() { return id; } @@ -91,7 +97,7 @@ public String getHookIp() { if (ObjectUtils.isEmpty(hookIp)){ - return sipIp.split(",")[0]; + return sipIp; }else { return hookIp; } @@ -212,18 +218,30 @@ mediaServerItem.setSendRtpPortRange(rtpSendPortRange); mediaServerItem.setRecordAssistPort(recordAssistPort); mediaServerItem.setHookAliveInterval(30.00f); - + mediaServerItem.setRecordDay(recordDay); + if (recordPath != null) { + mediaServerItem.setRecordPath(recordPath); + } mediaServerItem.setCreateTime(DateUtil.getNow()); mediaServerItem.setUpdateTime(DateUtil.getNow()); return mediaServerItem; } - private boolean isValidIPAddress(String ipAddress) { - if ((ipAddress != null) && (!ipAddress.isEmpty())) { - return Pattern.matches("^([1-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3}$", ipAddress); - } - return false; + public Integer getRecordDay() { + return recordDay; + } + + public void setRecordDay(Integer recordDay) { + this.recordDay = recordDay; + } + + public String getRecordPath() { + return recordPath; + } + + public void setRecordPath(String recordPath) { + this.recordPath = recordPath; } public String getRtpSendPortRange() { @@ -233,4 +251,11 @@ public void setRtpSendPortRange(String rtpSendPortRange) { this.rtpSendPortRange = rtpSendPortRange; } + + private boolean isValidIPAddress(String ipAddress) { + if ((ipAddress != null) && (!ipAddress.isEmpty())) { + return Pattern.matches("^([1-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3}$", ipAddress); + } + return false; + } } -- Gitblit v1.8.0