修复通道列表音频开关

This commit is contained in:
648540858
2024-09-19 10:03:32 +08:00
parent 2f9dc36405
commit 91c4677de4
6 changed files with 28 additions and 43 deletions

View File

@@ -16,14 +16,6 @@ import java.util.List;
*/
public interface IDeviceChannelService {
/**
* 添加设备通道
*
* @param deviceId 设备id
* @param channel 通道
*/
void updateChannel(String deviceId, DeviceChannel channel);
/**
* 批量添加设备通道
*/
@@ -125,4 +117,6 @@ public interface IDeviceChannelService {
DeviceChannel getOneForSourceById(Integer channelId);
DeviceChannel getBroadcastChannel(int deviceDbId);
void changeAudio(Integer channelId, Boolean audio);
}

View File

@@ -74,26 +74,6 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
private IPlatformChannelService platformChannelService;
@Override
public void updateChannel(String deviceId, DeviceChannel channel) {
String channelId = channel.getDeviceId();
channel.setDeviceId(deviceId);
InviteInfo inviteInfo = inviteStreamService.getInviteInfoByDeviceAndChannel(InviteSessionType.PLAY, channel.getId());
if (inviteInfo != null && inviteInfo.getStreamInfo() != null) {
channel.setStreamId(inviteInfo.getStreamInfo().getStream());
}
String now = DateUtil.getNow();
channel.setUpdateTime(now);
DeviceChannel deviceChannel = getOne(deviceId, channelId);
if (deviceChannel == null) {
channel.setCreateTime(now);
channelMapper.add(channel);
}else {
channelMapper.update(channel);
}
channelMapper.updateChannelSubCount(channel.getDeviceDbId(),channel.getParentId());
}
@Override
public int updateChannels(Device device, List<DeviceChannel> channels) {
List<DeviceChannel> addChannels = new ArrayList<>();
@@ -623,4 +603,9 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
}
return null;
}
@Override
public void changeAudio(Integer channelId, Boolean audio) {
channelMapper.changeAudio(channelId, audio);
}
}