Commit dabee4ed7d503a06a78a7c12491416206a48eec1

Authored by XiaoQiTong
1 parent ad246bf9

增加指定流媒体收流功能

sql/mysql.sql
... ... @@ -48,6 +48,7 @@ CREATE TABLE `device` (
48 48 `ssrcCheck` int DEFAULT '0',
49 49 `geoCoordSys` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
50 50 `treeType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  51 + `mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'auto',
51 52 PRIMARY KEY (`id`),
52 53 UNIQUE KEY `device_deviceId_uindex` (`deviceId`)
53 54 ) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
... ...
src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
... ... @@ -407,7 +407,7 @@ public class PlayServiceImpl implements IPlayService {
407 407 }
408 408 String mediaServerId = device.getMediaServerId();
409 409 MediaServerItem mediaServerItem;
410   - if (mediaServerId == null) {
  410 + if (mediaServerId == null || "".equals(device.getMediaServerId()) || "auto".equals(device.getMediaServerId())) {
411 411 mediaServerItem = mediaServerService.getMediaServerForMinimumLoad();
412 412 } else {
413 413 mediaServerItem = mediaServerService.getOne(mediaServerId);
... ...
src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java
... ... @@ -98,7 +98,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
98 98 @Override
99 99 public StreamInfo save(StreamProxyItem param) {
100 100 MediaServerItem mediaInfo;
101   - if (param.getMediaServerId() == null || "auto".equals(param.getMediaServerId())){
  101 + if (param.getMediaServerId() == null || "".equals(param.getMediaServerId()) || "auto".equals(param.getMediaServerId())){
102 102 mediaInfo = mediaServerService.getMediaServerForMinimumLoad();
103 103 }else {
104 104 mediaInfo = mediaServerService.getOne(param.getMediaServerId());
... ...
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java
... ... @@ -93,6 +93,7 @@ public interface DeviceMapper {
93 93 "<if test=\"ssrcCheck != null\">, ssrcCheck=${ssrcCheck}</if>" +
94 94 "<if test=\"geoCoordSys != null\">, geoCoordSys=#{geoCoordSys}</if>" +
95 95 "<if test=\"treeType != null\">, treeType=#{treeType}</if>" +
  96 + "<if test=\"mediaServerId != null\">, mediaServerId=#{mediaServerId}</if>" +
96 97 "WHERE deviceId='${deviceId}'"+
97 98 " </script>"})
98 99 int update(Device device);
... ...
web_src/src/components/dialog/deviceEdit.vue
... ... @@ -18,17 +18,17 @@
18 18 <el-form-item label="设备名称" prop="name">
19 19 <el-input v-model="form.name" clearable></el-input>
20 20 </el-form-item>
21   -<!-- <el-form-item label="流媒体ID" prop="mediaServerId">-->
22   -<!-- <el-select v-model="form.mediaServerId" style="float: left; width: 100%" >-->
23   -<!-- <el-option key="auto" label="自动负载最小" value="null"></el-option>-->
24   -<!-- <el-option-->
25   -<!-- v-for="item in mediaServerList"-->
26   -<!-- :key="item.id"-->
27   -<!-- :label="item.id"-->
28   -<!-- :value="item.id">-->
29   -<!-- </el-option>-->
30   -<!-- </el-select>-->
31   -<!-- </el-form-item>-->
  21 + <el-form-item label="流媒体ID" prop="mediaServerId">
  22 + <el-select v-model="form.mediaServerId" style="float: left; width: 100%" >
  23 + <el-option key="auto" label="自动负载最小" value="auto"></el-option>
  24 + <el-option
  25 + v-for="item in mediaServerList"
  26 + :key="item.id"
  27 + :label="item.id"
  28 + :value="item.id">
  29 + </el-option>
  30 + </el-select>
  31 + </el-form-item>
32 32  
33 33 <el-form-item label="字符集" prop="charset" >
34 34 <el-select v-model="form.charset" style="float: left; width: 100%" >
... ...