修复拉流代理相关问题

This commit is contained in:
panlinlin
2024-07-20 23:31:38 +08:00
parent 80ac701748
commit 0b7d55ed74
6 changed files with 51 additions and 37 deletions

View File

@@ -178,11 +178,13 @@ public class StreamProxyController {
@ResponseBody
@Operation(summary = "启用代理", security = @SecurityRequirement(name = JwtUtils.HEADER))
@Parameter(name = "id", description = "代理Id", required = true)
public void start(int id){
log.info("启用代理: " + id);
boolean result = streamProxyService.start(id);
if (!result) {
throw new ControllerException(ErrorCode.ERROR100);
public StreamContent start(int id){
log.info("播放代理: " + id);
StreamInfo streamInfo = streamProxyService.start(id);
if (streamInfo == null) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), ErrorCode.ERROR100.getMsg());
}else {
return new StreamContent(streamInfo);
}
}