临时提交
parent
c4804af026
commit
241fa9030a
|
@ -75,4 +75,6 @@ public interface ICommonGbChannelService {
|
|||
PageInfo<ShareCommonChannelListResult> getShareChannelList(int platformId, int page, int count, String query, String type, Boolean online);
|
||||
|
||||
void ptzControl(CommonGbChannel channel, PTZCommand ptzCommand);
|
||||
|
||||
CommonGbChannel getChannelById(int id);
|
||||
}
|
||||
|
|
|
@ -90,4 +90,9 @@ public interface IDeviceChannelService {
|
|||
* 根据通道ID获取设备
|
||||
*/
|
||||
Device getDeviceByChannelCommonGbId(int commonGbId);
|
||||
|
||||
/**
|
||||
* 根据通用通道ID查询通道
|
||||
*/
|
||||
DeviceChannel getChannelByCommonChannelId(int commonGbId);
|
||||
}
|
||||
|
|
|
@ -117,4 +117,9 @@ public interface IStreamPushService {
|
|||
* 设置推流离线
|
||||
*/
|
||||
void offline(String app, String stream);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
StreamPush getPushByCommonChannelId(int commonGbId);
|
||||
}
|
||||
|
|
|
@ -496,4 +496,9 @@ public class CommonGbChannelServiceImpl implements ICommonGbChannelService {
|
|||
assert resourceService != null;
|
||||
resourceService.ptzControl(channel, ptzCommand);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonGbChannel getChannelById(int id) {
|
||||
return commonGbChannelMapper.getOne(id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -758,4 +758,9 @@ public class DeviceChannelServiceImpl implements IDeviceChannelService {
|
|||
public Device getDeviceByChannelCommonGbId(int commonGbId) {
|
||||
return channelMapper.getDeviceByChannelCommonGbId(commonGbId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceChannel getChannelByCommonChannelId(int commonGbId) {
|
||||
return channelMapper.getChannelByCommonChannelId(commonGbId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,10 +2,18 @@ package com.genersoft.iot.vmp.vmanager.channel;
|
|||
|
||||
import com.genersoft.iot.vmp.common.CommonGbChannel;
|
||||
import com.genersoft.iot.vmp.conf.UserSetting;
|
||||
import com.genersoft.iot.vmp.conf.exception.ControllerException;
|
||||
import com.genersoft.iot.vmp.conf.security.JwtUtils;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.command.PTZCommand;
|
||||
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxy;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPush;
|
||||
import com.genersoft.iot.vmp.service.ICommonGbChannelService;
|
||||
import com.genersoft.iot.vmp.service.IDeviceChannelService;
|
||||
import com.genersoft.iot.vmp.service.IStreamProxyService;
|
||||
import com.genersoft.iot.vmp.service.IStreamPushService;
|
||||
import com.genersoft.iot.vmp.service.bean.CommonGbChannelType;
|
||||
import com.genersoft.iot.vmp.service.bean.DeviceType;
|
||||
import com.genersoft.iot.vmp.service.bean.IndustryCodeType;
|
||||
import com.genersoft.iot.vmp.service.bean.NetworkIdentificationType;
|
||||
|
@ -27,7 +35,9 @@ import org.springframework.web.context.request.async.DeferredResult;
|
|||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Tag(name = "通用国标通道")
|
||||
|
||||
|
@ -46,6 +56,15 @@ public class CommonChannelController {
|
|||
@Autowired
|
||||
private UserSetting userSetting;
|
||||
|
||||
@Autowired
|
||||
private IDeviceChannelService deviceChannelService;
|
||||
|
||||
@Autowired
|
||||
private IStreamPushService streamPushService;
|
||||
|
||||
@Autowired
|
||||
private IStreamProxyService streamProxyService;
|
||||
|
||||
|
||||
@Operation(summary = "更新通道信息", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||
@Parameter(name = "CommonGbChannel", description = "commonGbChannel", required = true)
|
||||
|
@ -355,16 +374,25 @@ public class CommonChannelController {
|
|||
}
|
||||
|
||||
// 获取通用通道对应的原始资源信息
|
||||
// @Operation(summary = "通用通道对应的原始资源信息", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||
// @Parameter(name = "param", description = "共享通道参数", required = true)
|
||||
// @GetMapping("/resource")
|
||||
// public void removeShareChannel(String id) {
|
||||
// CommonGbChannel commonGbChannel = commonGbChannelService.getChannelById(id);
|
||||
// if (commonGbChannel == null) {
|
||||
// throw new ControllerException(ErrorCode.ERROR100.getCode(), "通道不存在");
|
||||
// }
|
||||
//
|
||||
//
|
||||
// commonGbChannelService.removeShareChannel(param);
|
||||
// }
|
||||
@Operation(summary = "通用通道对应的原始资源信息", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||
@Parameter(name = "param", description = "共享通道参数", required = true)
|
||||
@GetMapping("/resource")
|
||||
public Map<String, Object> removeShareChannel(int id) {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
CommonGbChannel commonGbChannel = commonGbChannelService.getChannelById(id);
|
||||
if (commonGbChannel == null) {
|
||||
throw new ControllerException(ErrorCode.ERROR100.getCode(), "通道不存在");
|
||||
}
|
||||
if (commonGbChannel.getType().equals(CommonGbChannelType.GB28181)) {
|
||||
DeviceChannel deviceChannel = deviceChannelService.getChannelByCommonChannelId(commonGbChannel.getCommonGbId());
|
||||
resultMap.put(CommonGbChannelType.GB28181, deviceChannel);
|
||||
}else if (commonGbChannel.getType().equals(CommonGbChannelType.PUSH)) {
|
||||
StreamPush streamPush = streamPushService.getPushByCommonChannelId(commonGbChannel.getCommonGbId());
|
||||
resultMap.put(CommonGbChannelType.PUSH, streamPush);
|
||||
}else if (commonGbChannel.getType().equals(CommonGbChannelType.PROXY)) {
|
||||
StreamProxy streamProxy = streamProxyService.getProxyByCommonChnanelId(commonGbChannel.getCommonGbId());
|
||||
resultMap.put(CommonGbChannelType.PROXY, streamProxy);
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue