36 lines
971 B
C#
36 lines
971 B
C#
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: "相机采图成功。");
|
||
}
|
||
}
|
||
}
|