Eric 2 年之前
父节点
当前提交
e896c92ac2
共有 1 个文件被更改,包括 22 次插入0 次删除
  1. 22 0
      mec-biz/src/main/java/com/ym/mec/biz/dal/vo/ImLiveRoomVideoVo.java

+ 22 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/vo/ImLiveRoomVideoVo.java

@@ -3,6 +3,7 @@ package com.ym.mec.biz.dal.vo;
 import com.ym.mec.biz.dal.entity.ImLiveRoomVideo;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
+import org.apache.commons.lang3.StringUtils;
 
 import java.io.Serializable;
 
@@ -12,6 +13,9 @@ public class ImLiveRoomVideoVo extends ImLiveRoomVideo implements Serializable {
     @ApiModelProperty(value = "播出端-  pc网页端 移动端mobile")
     private String os;
 
+    @ApiModelProperty("视频类型")
+    private String videoType;
+
     public String getOs() {
         return os;
     }
@@ -19,4 +23,22 @@ public class ImLiveRoomVideoVo extends ImLiveRoomVideo implements Serializable {
     public void setOs(String os) {
         this.os = os;
     }
+
+    public String getVideoType() {
+
+        if (StringUtils.isNotEmpty(getUrl())) {
+
+            String fileName = getUrl();
+            int indexOf = fileName.lastIndexOf("?");
+            if (indexOf > -1) {
+                fileName = getUrl().substring(0, indexOf);
+            }
+            return fileName.substring(fileName.lastIndexOf(".") + 1);
+        }
+        return videoType;
+    }
+
+    public void setVideoType(String videoType) {
+        this.videoType = videoType;
+    }
 }