|
|
@ -10,8 +10,9 @@ namespace OnvifWebServer.Controllers.Onvif |
|
|
|
/// <summary>
|
|
|
|
/// Onvif 移动参数控制
|
|
|
|
/// </summary>
|
|
|
|
[Route("onvif/[controller]")]
|
|
|
|
[ApiController] |
|
|
|
[ApiDescriptionSettings("Onvif")] |
|
|
|
[Route("onvif/[controller]")]
|
|
|
|
public class PTZController : ApiController |
|
|
|
{ |
|
|
|
private readonly IPTZBLL _ptzBLL; |
|
|
@ -48,8 +49,8 @@ namespace OnvifWebServer.Controllers.Onvif |
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost] |
|
|
|
public async Task<bool> AbsoluteMove( |
|
|
|
[Required][DataValidation(ValidationTypes.IPv4)] string ip, |
|
|
|
[Required] float pan, [Required] float tilt, [Required] float zoom) |
|
|
|
[FromForm][Required][DataValidation(ValidationTypes.IPv4)] string ip, |
|
|
|
[FromForm][Required] float pan, [FromForm][Required] float tilt, [FromForm][Required] float zoom) |
|
|
|
{ |
|
|
|
bool ret = await _ptzBLL.AbsoluteMove(ip, pan, tilt, zoom); |
|
|
|
return ret; |
|
|
@ -64,8 +65,8 @@ namespace OnvifWebServer.Controllers.Onvif |
|
|
|
/// <param name="zoom">变倍相对点[-1,1]</param>
|
|
|
|
[HttpPost] |
|
|
|
public async Task<bool> RelativeMove( |
|
|
|
[Required][DataValidation(ValidationTypes.IPv4)] string ip, |
|
|
|
[Required] float pan, [Required] float tilt, [Required] float zoom) |
|
|
|
[FromForm][Required][DataValidation(ValidationTypes.IPv4)] string ip, |
|
|
|
[FromForm][Required] float pan, [FromForm][Required] float tilt, [FromForm][Required] float zoom) |
|
|
|
{ |
|
|
|
bool ret = await _ptzBLL.RelativeMove(ip, pan, tilt, zoom); |
|
|
|
return ret; |
|
|
@ -80,8 +81,8 @@ namespace OnvifWebServer.Controllers.Onvif |
|
|
|
/// <param name="zoom">变倍移动速度[-1,1]</param>
|
|
|
|
[HttpPost] |
|
|
|
public async Task<bool> ContinuousMove( |
|
|
|
[Required][DataValidation(ValidationTypes.IPv4)] string ip, |
|
|
|
[Required] float pan, [Required] float tilt, [Required] float zoom) |
|
|
|
[FromForm][Required][DataValidation(ValidationTypes.IPv4)] string ip, |
|
|
|
[FromForm][Required] float pan, [FromForm][Required] float tilt, [FromForm][Required] float zoom) |
|
|
|
{ |
|
|
|
bool ret = await _ptzBLL.ContinuousMove(ip, pan, tilt, zoom); |
|
|
|
return ret; |
|
|
@ -93,7 +94,7 @@ namespace OnvifWebServer.Controllers.Onvif |
|
|
|
/// <param name="ip">IP地址</param>
|
|
|
|
[HttpPost] |
|
|
|
public async Task<bool> StopMove( |
|
|
|
[Required][DataValidation(ValidationTypes.IPv4)] string ip) |
|
|
|
[FromForm][Required][DataValidation(ValidationTypes.IPv4)] string ip) |
|
|
|
{ |
|
|
|
bool ret = await _ptzBLL.StopMove(ip); |
|
|
|
return ret; |
|
|
|