fix: 修复摄像头无法正常启动,以及关闭摄像头会导致后端崩溃的问题

This commit is contained in:
2025-08-18 19:14:02 +08:00
parent 7265b10870
commit 1b5b0e28e3
8 changed files with 640 additions and 75 deletions

View File

@@ -146,7 +146,7 @@ public class VideoStreamController : ControllerBase
}
[HttpPost("SetVideoStreamEnable")]
[ProducesResponseType(typeof(object), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(string), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(string), StatusCodes.Status500InternalServerError)]
public async Task<IActionResult> SetVideoStreamEnable(bool enable)
{
@@ -155,7 +155,7 @@ public class VideoStreamController : ControllerBase
var boardId = TryGetBoardId().OrThrow(() => new ArgumentException("Board ID is required"));
await _videoStreamService.SetVideoStreamEnableAsync(boardId.ToString(), enable);
return Ok($"HDMI transmission for board {boardId} disabled.");
return Ok($"HDMI transmission for board {boardId} {enable.ToString()}.");
}
catch (Exception ex)
{