调整参数名称
parent
b1d9ea8082
commit
1909c7f71f
|
@ -43,9 +43,9 @@ public interface IStreamPushService {
|
||||||
/**
|
/**
|
||||||
* 停止一路推流
|
* 停止一路推流
|
||||||
* @param app 应用名
|
* @param app 应用名
|
||||||
* @param streamId 流ID
|
* @param stream 流ID
|
||||||
*/
|
*/
|
||||||
boolean stop(String app, String streamId);
|
boolean stop(String app, String stream);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新的节点加入
|
* 新的节点加入
|
||||||
|
|
|
@ -274,19 +274,19 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean stop(String app, String streamId) {
|
public boolean stop(String app, String stream) {
|
||||||
logger.info("[推流 ] 停止流: {}/{}", app, streamId);
|
logger.info("[推流 ] 停止流: {}/{}", app, stream);
|
||||||
StreamPushItem streamPushItem = streamPushMapper.selectOne(app, streamId);
|
StreamPushItem streamPushItem = streamPushMapper.selectOne(app, stream);
|
||||||
if (streamPushItem != null) {
|
if (streamPushItem != null) {
|
||||||
gbStreamService.sendCatalogMsg(streamPushItem, CatalogEvent.DEL);
|
gbStreamService.sendCatalogMsg(streamPushItem, CatalogEvent.DEL);
|
||||||
}
|
}
|
||||||
|
|
||||||
platformGbStreamMapper.delByAppAndStream(app, streamId);
|
platformGbStreamMapper.delByAppAndStream(app, stream);
|
||||||
gbStreamMapper.del(app, streamId);
|
gbStreamMapper.del(app, stream);
|
||||||
int delStream = streamPushMapper.del(app, streamId);
|
int delStream = streamPushMapper.del(app, stream);
|
||||||
if (delStream > 0) {
|
if (delStream > 0) {
|
||||||
MediaServer mediaServerItem = mediaServerService.getOne(streamPushItem.getMediaServerId());
|
MediaServer mediaServerItem = mediaServerService.getOne(streamPushItem.getMediaServerId());
|
||||||
mediaServerService.closeStreams(mediaServerItem,app, streamId);
|
mediaServerService.closeStreams(mediaServerItem,app, stream);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,9 +112,9 @@ public class StreamPushController {
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@Operation(summary = "中止一个推流", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
@Operation(summary = "中止一个推流", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||||
@Parameter(name = "app", description = "应用名", required = true)
|
@Parameter(name = "app", description = "应用名", required = true)
|
||||||
@Parameter(name = "streamId", description = "流id", required = true)
|
@Parameter(name = "stream", description = "流id", required = true)
|
||||||
public void stop(String app, String streamId){
|
public void stop(String app, String stream){
|
||||||
if (!streamPushService.stop(app, streamId)){
|
if (!streamPushService.stop(app, stream)){
|
||||||
throw new ControllerException(ErrorCode.ERROR100);
|
throw new ControllerException(ErrorCode.ERROR100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue