using EC.App.Core; using EC.App.ThatBLL.Onvif; using Furion.DataValidation; using Microsoft.AspNetCore.Mvc; using System.ComponentModel.DataAnnotations; using System.Threading.Tasks; namespace OnvifWebServer.Controllers.Onvif { /// /// Onvif 成像参数控制 /// [ApiController] [ApiDescriptionSettings("Onvif")] [Route("onvif/[controller]")] public class ImagingController : ApiController { private readonly IImagingBLL _imagingBLL; /// /// /// /// public ImagingController(IImagingBLL imagingBLL) { this._imagingBLL = imagingBLL; } /// /// 是否连接 /// /// /// [HttpGet] public bool IsConnected( [Required][DataValidation(ValidationTypes.IPv4)] string ip) { bool ret = _imagingBLL.IsConnected(ip); return ret; } /// /// 变焦绝对移动 /// /// /// /// [HttpPost] public async Task FocusAbsoluteMove( [FromForm][Required][DataValidation(ValidationTypes.IPv4)] string ip, [FromForm][Required] float position) { bool ret = await _imagingBLL.FocusAbsoluteMove(ip, position); return ret; } /// /// 变焦相对移动 /// /// /// /// [HttpPost] public async Task FocusRelativeMove( [FromForm][Required][DataValidation(ValidationTypes.IPv4)] string ip, [FromForm][Required] float distance) { bool ret = await _imagingBLL.FocusRelativeMove(ip, distance); return ret; } /// /// 变焦持续移动 /// /// /// /// [HttpPost] public async Task FocusContinuousMove( [FromForm][Required][DataValidation(ValidationTypes.IPv4)] string ip, [FromForm][Required] float speed) { bool ret = await _imagingBLL.FocusContinuousMove(ip, speed); return ret; } /// /// 停止变焦 /// /// IP地址 [HttpPost] public async Task FocusStopMove( [FromForm][Required][DataValidation(ValidationTypes.IPv4)] string ip) { bool ret = await _imagingBLL.FocusStopMove(ip); return ret; } } }