Browse Source

代理url

xujunwei 1 year atrás
parent
commit
69e3347e6e
1 changed files with 21 additions and 0 deletions
  1. 21 0
      src/main/java/com/genersoft/iot/vmp/extend/entity/ExtendRecord.java

+ 21 - 0
src/main/java/com/genersoft/iot/vmp/extend/entity/ExtendRecord.java

@@ -1,6 +1,7 @@
 package com.genersoft.iot.vmp.extend.entity;
 
 import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.genersoft.iot.vmp.service.bean.DownloadFileInfo;
@@ -99,4 +100,24 @@ public class ExtendRecord {
         return DateUtil.formatDateTime(new Date(endTime));
     }
 
+    /**
+     * 设备id
+     */
+    public String getDeviceId() {
+        if(StrUtil.isNotBlank(stream) && stream.contains("_")) {
+            return stream.substring(0,stream.indexOf("_"));
+        }
+        return stream;
+    }
+
+    /**
+     * 通道id
+     */
+    public String getChannelId() {
+        if(StrUtil.isNotBlank(stream) && stream.contains("_")) {
+            return stream.substring(stream.indexOf("_"));
+        }
+        return stream;
+    }
+
 }