临时提交

This commit is contained in:
648540858
2024-07-22 14:20:40 +08:00
parent 2f4d983f9f
commit c96c29776d
4 changed files with 37 additions and 8 deletions

View File

@@ -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);
}
}

View File

@@ -94,4 +94,6 @@ public interface IStreamProxyService {
void delete(int id);
StreamInfo start(int id);
void stop(int id);
}

View File

@@ -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() {