添加语音发送通道和语音接收通道字段
parent
ee2dda21f0
commit
ca16a79255
|
@ -44,6 +44,8 @@ CREATE TABLE `device` (
|
||||||
`mobilePositionSubmissionInterval` int(11) NOT NULL DEFAULT '5',
|
`mobilePositionSubmissionInterval` int(11) NOT NULL DEFAULT '5',
|
||||||
`subscribeCycleForAlarm` int(11) NOT NULL,
|
`subscribeCycleForAlarm` int(11) NOT NULL,
|
||||||
`hostAddress` varchar(50) NOT NULL,
|
`hostAddress` varchar(50) NOT NULL,
|
||||||
|
`audioChannelForReceive` varchar(50) NOT NULL,
|
||||||
|
`audioChannelForSend` varchar(50) NOT NULL,
|
||||||
`charset` varchar(50) NOT NULL,
|
`charset` varchar(50) NOT NULL,
|
||||||
`ssrcCheck` int(11) DEFAULT '0',
|
`ssrcCheck` int(11) DEFAULT '0',
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
|
|
|
@ -1,12 +1,5 @@
|
||||||
alter table parent_platform
|
alter table device
|
||||||
add startOfflinePush int default 0 null;
|
add audioChannelForReceive VARCHAR(50) null;
|
||||||
|
|
||||||
alter table parent_platform
|
|
||||||
add administrativeDivision varchar(50) not null;
|
|
||||||
|
|
||||||
alter table parent_platform
|
|
||||||
add catalogGroup int default 1 null;
|
|
||||||
|
|
||||||
alter table device
|
alter table device
|
||||||
add ssrcCheck int default 0 null;
|
add audioChannelForSend VARCHAR(50) null;
|
||||||
|
|
|
@ -23,7 +23,6 @@ public class VManageBootstrap extends LogManager {
|
||||||
private static ConfigurableApplicationContext context;
|
private static ConfigurableApplicationContext context;
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
VManageBootstrap.args = args;
|
VManageBootstrap.args = args;
|
||||||
System.out.println("test");
|
|
||||||
VManageBootstrap.context = SpringApplication.run(VManageBootstrap.class, args);
|
VManageBootstrap.context = SpringApplication.run(VManageBootstrap.class, args);
|
||||||
}
|
}
|
||||||
// 项目重启
|
// 项目重启
|
||||||
|
|
|
@ -134,6 +134,16 @@ public class Device {
|
||||||
*/
|
*/
|
||||||
private boolean ssrcCheck;
|
private boolean ssrcCheck;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备用于接收语音消息的通道
|
||||||
|
*/
|
||||||
|
private String audioChannelForReceive;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备用于发送语音消息的通道
|
||||||
|
*/
|
||||||
|
private String audioChannelForSend;
|
||||||
|
|
||||||
|
|
||||||
public String getDeviceId() {
|
public String getDeviceId() {
|
||||||
return deviceId;
|
return deviceId;
|
||||||
|
@ -334,4 +344,12 @@ public class Device {
|
||||||
public void setSsrcCheck(boolean ssrcCheck) {
|
public void setSsrcCheck(boolean ssrcCheck) {
|
||||||
this.ssrcCheck = ssrcCheck;
|
this.ssrcCheck = ssrcCheck;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getAudioChannelForReceive() {
|
||||||
|
return audioChannelForReceive;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAudioChannelForReceive(String audioChannelForReceive) {
|
||||||
|
this.audioChannelForReceive = audioChannelForReceive;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,8 @@ public interface DeviceMapper {
|
||||||
"subscribeCycleForMobilePosition," +
|
"subscribeCycleForMobilePosition," +
|
||||||
"mobilePositionSubmissionInterval," +
|
"mobilePositionSubmissionInterval," +
|
||||||
"subscribeCycleForAlarm," +
|
"subscribeCycleForAlarm," +
|
||||||
|
"audioChannelForReceive," +
|
||||||
|
"audioChannelForSend," +
|
||||||
"ssrcCheck," +
|
"ssrcCheck," +
|
||||||
"online" +
|
"online" +
|
||||||
") VALUES (" +
|
") VALUES (" +
|
||||||
|
@ -60,6 +62,8 @@ public interface DeviceMapper {
|
||||||
"#{subscribeCycleForMobilePosition}," +
|
"#{subscribeCycleForMobilePosition}," +
|
||||||
"#{mobilePositionSubmissionInterval}," +
|
"#{mobilePositionSubmissionInterval}," +
|
||||||
"#{subscribeCycleForAlarm}," +
|
"#{subscribeCycleForAlarm}," +
|
||||||
|
"#{audioChannelForReceive}," +
|
||||||
|
"#{audioChannelForSend}," +
|
||||||
"#{ssrcCheck}," +
|
"#{ssrcCheck}," +
|
||||||
"#{online}" +
|
"#{online}" +
|
||||||
")")
|
")")
|
||||||
|
@ -86,6 +90,8 @@ public interface DeviceMapper {
|
||||||
"<if test=\"subscribeCycleForMobilePosition != null\">, subscribeCycleForMobilePosition=${subscribeCycleForMobilePosition}</if>" +
|
"<if test=\"subscribeCycleForMobilePosition != null\">, subscribeCycleForMobilePosition=${subscribeCycleForMobilePosition}</if>" +
|
||||||
"<if test=\"mobilePositionSubmissionInterval != null\">, mobilePositionSubmissionInterval=${mobilePositionSubmissionInterval}</if>" +
|
"<if test=\"mobilePositionSubmissionInterval != null\">, mobilePositionSubmissionInterval=${mobilePositionSubmissionInterval}</if>" +
|
||||||
"<if test=\"subscribeCycleForAlarm != null\">, subscribeCycleForAlarm=${subscribeCycleForAlarm}</if>" +
|
"<if test=\"subscribeCycleForAlarm != null\">, subscribeCycleForAlarm=${subscribeCycleForAlarm}</if>" +
|
||||||
|
"<if test=\"audioChannelForReceive != null\">, audioChannelForReceive=#{audioChannelForReceive}</if>" +
|
||||||
|
"<if test=\"audioChannelForSend != null\">, audioChannelForSend=#{audioChannelForSend}</if>" +
|
||||||
"<if test=\"ssrcCheck != null\">, ssrcCheck=${ssrcCheck}</if>" +
|
"<if test=\"ssrcCheck != null\">, ssrcCheck=${ssrcCheck}</if>" +
|
||||||
"WHERE deviceId='${deviceId}'"+
|
"WHERE deviceId='${deviceId}'"+
|
||||||
" </script>"})
|
" </script>"})
|
||||||
|
|
|
@ -251,20 +251,32 @@ public class PlayController {
|
||||||
@ApiOperation("语音广播命令")
|
@ApiOperation("语音广播命令")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "deviceId", value = "设备Id", dataTypeClass = String.class),
|
@ApiImplicitParam(name = "deviceId", value = "设备Id", dataTypeClass = String.class),
|
||||||
|
@ApiImplicitParam(name = "channelForSend", value = "设备用于发送语音数据的通道", dataTypeClass = String.class),
|
||||||
|
@ApiImplicitParam(name = "channelForReceive", value = "设备用于接收语音数据的通道", dataTypeClass = String.class),
|
||||||
})
|
})
|
||||||
@GetMapping("/broadcast/{deviceId}")
|
@GetMapping("/broadcast/{deviceId}")
|
||||||
@PostMapping("/broadcast/{deviceId}")
|
@PostMapping("/broadcast/{deviceId}")
|
||||||
public DeferredResult<ResponseEntity<String>> broadcastApi(@PathVariable String deviceId) {
|
public DeferredResult<ResponseEntity<String>> broadcastApi(@PathVariable String deviceId,
|
||||||
|
String channelForSend,
|
||||||
|
String channelForReceive) {
|
||||||
if (logger.isDebugEnabled()) {
|
if (logger.isDebugEnabled()) {
|
||||||
logger.debug("语音广播API调用");
|
logger.debug("语音广播API调用");
|
||||||
}
|
}
|
||||||
Device device = storager.queryVideoDevice(deviceId);
|
Device device = storager.queryVideoDevice(deviceId);
|
||||||
DeferredResult<ResponseEntity<String>> result = new DeferredResult<ResponseEntity<String>>(3 * 1000L);
|
DeferredResult<ResponseEntity<String>> result = new DeferredResult<>(3 * 1000L);
|
||||||
String key = DeferredResultHolder.CALLBACK_CMD_BROADCAST + deviceId;
|
String key = DeferredResultHolder.CALLBACK_CMD_BROADCAST + deviceId;
|
||||||
if (resultHolder.exist(key, null)) {
|
if (resultHolder.exist(key, null)) {
|
||||||
result.setResult(new ResponseEntity<>("设备使用中",HttpStatus.OK));
|
result.setResult(new ResponseEntity<>("设备使用中",HttpStatus.OK));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// playService.audioBroadcast(deviceId, channelForSend, channelForReceive);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String uuid = UUID.randomUUID().toString();
|
String uuid = UUID.randomUUID().toString();
|
||||||
if (device == null) {
|
if (device == null) {
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,12 @@
|
||||||
<el-option key="UTF-8" label="UTF-8" value="utf-8"></el-option>
|
<el-option key="UTF-8" label="UTF-8" value="utf-8"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="语音发送通道" prop="name">
|
||||||
|
<el-input v-model="form.audioChannelForSend" clearable></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="语音接收送通道" prop="name">
|
||||||
|
<el-input v-model="form.audioChannelForReceive" clearable></el-input>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="目录订阅" title="0为取消订阅" prop="subscribeCycleForCatalog" >
|
<el-form-item label="目录订阅" title="0为取消订阅" prop="subscribeCycleForCatalog" >
|
||||||
<el-input v-model="form.subscribeCycleForCatalog" clearable ></el-input>
|
<el-input v-model="form.subscribeCycleForCatalog" clearable ></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -99,8 +105,6 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onSubmit: function () {
|
onSubmit: function () {
|
||||||
console.log("onSubmit");
|
|
||||||
console.log(this.form);
|
|
||||||
this.form.subscribeCycleForCatalog = this.form.subscribeCycleForCatalog||0
|
this.form.subscribeCycleForCatalog = this.form.subscribeCycleForCatalog||0
|
||||||
this.form.subscribeCycleForMobilePosition = this.form.subscribeCycleForMobilePosition||0
|
this.form.subscribeCycleForMobilePosition = this.form.subscribeCycleForMobilePosition||0
|
||||||
this.form.mobilePositionSubmissionInterval = this.form.mobilePositionSubmissionInterval||0
|
this.form.mobilePositionSubmissionInterval = this.form.mobilePositionSubmissionInterval||0
|
||||||
|
@ -120,7 +124,7 @@ export default {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}).catch(function (error) {
|
}).catch(function (error) {
|
||||||
console.log(error);
|
console.error(error);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
close: function () {
|
close: function () {
|
||||||
|
|
Loading…
Reference in New Issue