临时提交
This commit is contained in:
@@ -192,10 +192,9 @@ public class StreamProxyController {
|
||||
@GetMapping(value = "/stop")
|
||||
@ResponseBody
|
||||
@Operation(summary = "停用代理", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||
@Parameter(name = "app", description = "应用名", required = true)
|
||||
@Parameter(name = "stream", description = "流id", required = true)
|
||||
public void stop(String app, String stream){
|
||||
log.info("停用代理: " + app + "/" + stream);
|
||||
streamProxyService.stopByAppAndStream(app, stream);
|
||||
@Parameter(name = "id", description = "代理Id", required = true)
|
||||
public void stop(int id){
|
||||
log.info("停用代理: {}", id);
|
||||
streamProxyService.stop(id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,4 +94,6 @@ public interface IStreamProxyService {
|
||||
void delete(int id);
|
||||
|
||||
StreamInfo start(int id);
|
||||
|
||||
void stop(int id);
|
||||
}
|
||||
|
||||
@@ -474,8 +474,14 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
||||
return streamProxyMapper.select(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void stop(int id) {
|
||||
StreamProxy streamProxy = streamProxyMapper.select(id);
|
||||
if (streamProxy == null) {
|
||||
throw new ControllerException(ErrorCode.ERROR404.getCode(), "代理信息未找到");
|
||||
}
|
||||
stopProxy(streamProxy);
|
||||
}
|
||||
|
||||
// @Scheduled(cron = "* 0/10 * * * ?")
|
||||
// public void asyncCheckStreamProxyStatus() {
|
||||
|
||||
Reference in New Issue
Block a user