You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
iot/projects/IoT/IoTServices/ONVIFService/Controllers/CameraController.cs

91 lines
3.3 KiB

using Application.Models;
using IoT.Shared.Controllers;
using Microsoft.AspNetCore.Mvc;
using Swashbuckle.AspNetCore.Annotations;
using System;
namespace ONVIFService.Controllers
{
[SwaggerTag("摄像头")]
public class CameraController : BaseDeviceController
{
private readonly DeviceService _deviceService;
public CameraController(IServiceProvider applicationServices, DeviceService deviceService) : base(applicationServices)
{
this._deviceService = deviceService;
}
[HttpGet, Route("/[controller]/[action]"), SwaggerOperation("")]
public ApiResponse ScreenShot([SwaggerParameter("网关编号")]string gateway, [SwaggerParameter("设备编号")]string number)
{
return this.AsyncAction(() =>
{
this._deviceService.ScreenShot(number);
});
}
[HttpGet, Route("/[controller]/[action]"), SwaggerOperation("")]
public ApiResponse Up([SwaggerParameter("网关编号")]string gateway, [SwaggerParameter("设备编号")]string number)
{
return this.AsyncAction(() =>
{
this._deviceService.Up(number, 0.5f);
});
}
[HttpGet, Route("/[controller]/[action]"), SwaggerOperation("")]
public ApiResponse Down([SwaggerParameter("网关编号")]string gateway, [SwaggerParameter("设备编号")]string number)
{
return this.AsyncAction(() =>
{
this._deviceService.Down(number, 0.5f);
});
}
[HttpGet, Route("/[controller]/[action]"), SwaggerOperation("")]
public ApiResponse Left([SwaggerParameter("网关编号")]string gateway, [SwaggerParameter("设备编号")]string number)
{
return this.AsyncAction(() =>
{
this._deviceService.Left(number, 0.5f);
});
}
[HttpGet, Route("/[controller]/[action]"), SwaggerOperation("")]
public ApiResponse Right([SwaggerParameter("网关编号")]string gateway, [SwaggerParameter("设备编号")]string number)
{
return this.AsyncAction(() =>
{
this._deviceService.Right(number, 0.5f);
});
}
[HttpGet, Route("/[controller]/[action]"), SwaggerOperation("")]
public ApiResponse Zoomin([SwaggerParameter("网关编号")]string gateway, [SwaggerParameter("设备编号")]string number)
{
return this.AsyncAction(() =>
{
this._deviceService.ZoomIn(number, 0.5f);
});
}
[HttpGet, Route("/[controller]/[action]"), SwaggerOperation("")]
public ApiResponse Zoomout([SwaggerParameter("网关编号")]string gateway, [SwaggerParameter("设备编号")]string number)
{
return this.AsyncAction(() =>
{
this._deviceService.ZoomOut(number, 0.5f);
});
}
[HttpGet, Route("/[controller]/[action]"), SwaggerOperation("")]
public ApiResponse Stop([SwaggerParameter("网关编号")]string gateway, [SwaggerParameter("设备编号")]string number)
{
return this.AsyncAction(() =>
{
this._deviceService.Stop(number);
});
}
}
}