Files
OrpaonVision/OrpaonVision.SiteApp/Runtime/Services/MockCameraService.cs
2026-04-06 22:04:05 +08:00

36 lines
971 B
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using OrpaonVision.Core.Results;
using OrpaonVision.SiteApp.Runtime.Contracts;
using OrpaonVision.SiteApp.Runtime.Options;
namespace OrpaonVision.SiteApp.Runtime.Services
{
/// <summary>
/// 相机服务模拟实现MVP 阶段)。
/// </summary>
public sealed class MockCameraService : ICameraService
{
private readonly RuntimeOptions _options;
/// <summary>
/// 构造函数。
/// </summary>
public MockCameraService(RuntimeOptions options)
{
_options = options;
}
/// <inheritdoc />
public Result<CameraFrameDto> CaptureFrame()
{
var frame = new CameraFrameDto
{
FrameId = Guid.NewGuid(),
CapturedAtUtc = DateTime.UtcNow,
CameraId = _options.CameraId
};
return Result<CameraFrameDto>.Success(frame, message: "相机采图成功。");
}
}
}