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