版本260406
This commit is contained in:
35
OrpaonVision.SiteApp/Runtime/Services/MockCameraService.cs
Normal file
35
OrpaonVision.SiteApp/Runtime/Services/MockCameraService.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
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: "相机采图成功。");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user