添加语音发送通道和语音接收通道字段

结构优化
648540858 2022-05-07 09:52:02 +08:00
parent ee2dda21f0
commit ca16a79255
7 changed files with 50 additions and 16 deletions

View File

@ -44,6 +44,8 @@ CREATE TABLE `device` (
`mobilePositionSubmissionInterval` int(11) NOT NULL DEFAULT '5',
`subscribeCycleForAlarm` int(11) NOT NULL,
`hostAddress` varchar(50) NOT NULL,
`audioChannelForReceive` varchar(50) NOT NULL,
`audioChannelForSend` varchar(50) NOT NULL,
`charset` varchar(50) NOT NULL,
`ssrcCheck` int(11) DEFAULT '0',
PRIMARY KEY (`id`),

View File

@ -1,12 +1,5 @@
alter table parent_platform
add startOfflinePush int default 0 null;
alter table parent_platform
add administrativeDivision varchar(50) not null;
alter table parent_platform
add catalogGroup int default 1 null;
alter table device
add audioChannelForReceive VARCHAR(50) null;
alter table device
add ssrcCheck int default 0 null;
add audioChannelForSend VARCHAR(50) null;

View File

@ -23,7 +23,6 @@ public class VManageBootstrap extends LogManager {
private static ConfigurableApplicationContext context;
public static void main(String[] args) {
VManageBootstrap.args = args;
System.out.println("test");
VManageBootstrap.context = SpringApplication.run(VManageBootstrap.class, args);
}
// 项目重启

View File

@ -134,6 +134,16 @@ public class Device {
*/
private boolean ssrcCheck;
/**
*
*/
private String audioChannelForReceive;
/**
*
*/
private String audioChannelForSend;
public String getDeviceId() {
return deviceId;
@ -334,4 +344,12 @@ public class Device {
public void setSsrcCheck(boolean ssrcCheck) {
this.ssrcCheck = ssrcCheck;
}
public String getAudioChannelForReceive() {
return audioChannelForReceive;
}
public void setAudioChannelForReceive(String audioChannelForReceive) {
this.audioChannelForReceive = audioChannelForReceive;
}
}

View File

@ -37,6 +37,8 @@ public interface DeviceMapper {
"subscribeCycleForMobilePosition," +
"mobilePositionSubmissionInterval," +
"subscribeCycleForAlarm," +
"audioChannelForReceive," +
"audioChannelForSend," +
"ssrcCheck," +
"online" +
") VALUES (" +
@ -60,6 +62,8 @@ public interface DeviceMapper {
"#{subscribeCycleForMobilePosition}," +
"#{mobilePositionSubmissionInterval}," +
"#{subscribeCycleForAlarm}," +
"#{audioChannelForReceive}," +
"#{audioChannelForSend}," +
"#{ssrcCheck}," +
"#{online}" +
")")
@ -86,6 +90,8 @@ public interface DeviceMapper {
"<if test=\"subscribeCycleForMobilePosition != null\">, subscribeCycleForMobilePosition=${subscribeCycleForMobilePosition}</if>" +
"<if test=\"mobilePositionSubmissionInterval != null\">, mobilePositionSubmissionInterval=${mobilePositionSubmissionInterval}</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>" +
"WHERE deviceId='${deviceId}'"+
" </script>"})

View File

@ -251,20 +251,32 @@ public class PlayController {
@ApiOperation("语音广播命令")
@ApiImplicitParams({
@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}")
@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()) {
logger.debug("语音广播API调用");
}
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;
if (resultHolder.exist(key, null)) {
result.setResult(new ResponseEntity<>("设备使用中",HttpStatus.OK));
return result;
}
// playService.audioBroadcast(deviceId, channelForSend, channelForReceive);
String uuid = UUID.randomUUID().toString();
if (device == null) {

View File

@ -36,6 +36,12 @@
<el-option key="UTF-8" label="UTF-8" value="utf-8"></el-option>
</el-select>
</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-input v-model="form.subscribeCycleForCatalog" clearable ></el-input>
</el-form-item>
@ -99,8 +105,6 @@ export default {
})
},
onSubmit: function () {
console.log("onSubmit");
console.log(this.form);
this.form.subscribeCycleForCatalog = this.form.subscribeCycleForCatalog||0
this.form.subscribeCycleForMobilePosition = this.form.subscribeCycleForMobilePosition||0
this.form.mobilePositionSubmissionInterval = this.form.mobilePositionSubmissionInterval||0
@ -120,7 +124,7 @@ export default {
});
}
}).catch(function (error) {
console.log(error);
console.error(error);
});
},
close: function () {