fajiao 3 years ago
parent
commit
9286afb09a
  1. 5
      BaseModule/EC.App/Core/ApiController.cs
  2. 11
      OnvifWebServer/Controllers/Onvif/CurdController.cs
  3. 3
      OnvifWebServer/Controllers/Onvif/DeviceController.cs
  4. 17
      OnvifWebServer/Controllers/Onvif/ImagingController.cs
  5. 3
      OnvifWebServer/Controllers/Onvif/MediaController.cs
  6. 17
      OnvifWebServer/Controllers/Onvif/PTZController.cs
  7. 3
      OnvifWebServer/Controllers/Onvif/TestController.cs

5
BaseModule/EC.App/Core/ApiController.cs

@ -1,11 +1,10 @@
using Furion.DependencyInjection; using Furion.DynamicApiController;
using Furion.DynamicApiController;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
namespace EC.App.Core namespace EC.App.Core
{ {
[ApiDescriptionSettings(false)]
[NonController] [NonController]
[ApiDescriptionSettings(false)]
public class ApiController : IDynamicApiController public class ApiController : IDynamicApiController
{ {
} }

11
OnvifWebServer/Controllers/Onvif/CurdController.cs

@ -10,8 +10,9 @@ namespace OnvifWebServer.Controllers.Onvif
/// <summary> /// <summary>
/// Onvif 增删改查 /// Onvif 增删改查
/// </summary> /// </summary>
[Route("onvif/[controller]")] [ApiController]
[ApiDescriptionSettings("Onvif")] [ApiDescriptionSettings("Onvif")]
[Route("onvif/[controller]")]
public class CurdController : ApiController public class CurdController : ApiController
{ {
private readonly ICurdBLL _curdBLL; private readonly ICurdBLL _curdBLL;
@ -34,8 +35,8 @@ namespace OnvifWebServer.Controllers.Onvif
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public async Task<bool> Add( public async Task<bool> Add(
[Required][DataValidation(ValidationTypes.IPv4)] string ip, [FromForm][Required][DataValidation(ValidationTypes.IPv4)] string ip,
[Required] string username, [Required] string password) [FromForm][Required] string username, [FromForm][Required] string password)
{ {
bool ret = await _curdBLL.Add(ip, username, password); bool ret = await _curdBLL.Add(ip, username, password);
return ret; return ret;
@ -63,8 +64,8 @@ namespace OnvifWebServer.Controllers.Onvif
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public async Task<bool> Update( public async Task<bool> Update(
[Required][DataValidation(ValidationTypes.IPv4)] string ip, [FromForm][Required][DataValidation(ValidationTypes.IPv4)] string ip,
[Required] string username, [Required] string password) [FromForm][Required] string username, [FromForm][Required] string password)
{ {
bool ret = await _curdBLL.Update(ip, username, password); bool ret = await _curdBLL.Update(ip, username, password);
return ret; return ret;

3
OnvifWebServer/Controllers/Onvif/DeviceController.cs

@ -9,8 +9,9 @@ namespace OnvifWebServer.Controllers.Onvif
/// <summary> /// <summary>
/// Onvif 设备参数控制 /// Onvif 设备参数控制
/// </summary> /// </summary>
[Route("onvif/[controller]")] [ApiController]
[ApiDescriptionSettings("Onvif")] [ApiDescriptionSettings("Onvif")]
[Route("onvif/[controller]")]
public class DeviceController : ApiController public class DeviceController : ApiController
{ {
private readonly IDeviceBLL _deviceBLL; private readonly IDeviceBLL _deviceBLL;

17
OnvifWebServer/Controllers/Onvif/ImagingController.cs

@ -10,8 +10,9 @@ namespace OnvifWebServer.Controllers.Onvif
/// <summary> /// <summary>
/// Onvif 成像参数控制 /// Onvif 成像参数控制
/// </summary> /// </summary>
[Route("onvif/[controller]")] [ApiController]
[ApiDescriptionSettings("Onvif")] [ApiDescriptionSettings("Onvif")]
[Route("onvif/[controller]")]
public class ImagingController : ApiController public class ImagingController : ApiController
{ {
private readonly IImagingBLL _imagingBLL; private readonly IImagingBLL _imagingBLL;
@ -46,8 +47,8 @@ namespace OnvifWebServer.Controllers.Onvif
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public async Task<bool> FocusAbsoluteMove( public async Task<bool> FocusAbsoluteMove(
[Required][DataValidation(ValidationTypes.IPv4)] string ip, [FromForm][Required][DataValidation(ValidationTypes.IPv4)] string ip,
[Required] float position) [FromForm][Required] float position)
{ {
bool ret = await _imagingBLL.FocusAbsoluteMove(ip, position); bool ret = await _imagingBLL.FocusAbsoluteMove(ip, position);
return ret; return ret;
@ -61,8 +62,8 @@ namespace OnvifWebServer.Controllers.Onvif
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public async Task<bool> FocusRelativeMove( public async Task<bool> FocusRelativeMove(
[Required][DataValidation(ValidationTypes.IPv4)] string ip, [FromForm][Required][DataValidation(ValidationTypes.IPv4)] string ip,
[Required] float distance) [FromForm][Required] float distance)
{ {
bool ret = await _imagingBLL.FocusRelativeMove(ip, distance); bool ret = await _imagingBLL.FocusRelativeMove(ip, distance);
return ret; return ret;
@ -76,8 +77,8 @@ namespace OnvifWebServer.Controllers.Onvif
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public async Task<bool> FocusContinuousMove( public async Task<bool> FocusContinuousMove(
[Required][DataValidation(ValidationTypes.IPv4)] string ip, [FromForm][Required][DataValidation(ValidationTypes.IPv4)] string ip,
[Required] float speed) [FromForm][Required] float speed)
{ {
bool ret = await _imagingBLL.FocusContinuousMove(ip, speed); bool ret = await _imagingBLL.FocusContinuousMove(ip, speed);
return ret; return ret;
@ -89,7 +90,7 @@ namespace OnvifWebServer.Controllers.Onvif
/// <param name="ip">IP地址</param> /// <param name="ip">IP地址</param>
[HttpPost] [HttpPost]
public async Task<bool> FocusStopMove( public async Task<bool> FocusStopMove(
[Required][DataValidation(ValidationTypes.IPv4)] string ip) [FromForm][Required][DataValidation(ValidationTypes.IPv4)] string ip)
{ {
bool ret = await _imagingBLL.FocusStopMove(ip); bool ret = await _imagingBLL.FocusStopMove(ip);
return ret; return ret;

3
OnvifWebServer/Controllers/Onvif/MediaController.cs

@ -10,8 +10,9 @@ namespace OnvifWebServer.Controllers.Onvif
/// <summary> /// <summary>
/// Onvif 媒体参数控制 /// Onvif 媒体参数控制
/// </summary> /// </summary>
[Route("onvif/[controller]")] [ApiController]
[ApiDescriptionSettings("Onvif")] [ApiDescriptionSettings("Onvif")]
[Route("onvif/[controller]")]
public class MediaController : ApiController public class MediaController : ApiController
{ {
private readonly IMediaBLL _mediaBLL; private readonly IMediaBLL _mediaBLL;

17
OnvifWebServer/Controllers/Onvif/PTZController.cs

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

3
OnvifWebServer/Controllers/Onvif/TestController.cs

@ -6,8 +6,9 @@ using System.ComponentModel.DataAnnotations;
namespace OnvifWebServer.Controllers.Onvif namespace OnvifWebServer.Controllers.Onvif
{ {
[Route("test/[controller]")] [ApiController]
[ApiDescriptionSettings("Test")] [ApiDescriptionSettings("Test")]
[Route("test/[controller]")]
public class TestController : ApiController public class TestController : ApiController
{ {
public TestController() public TestController()

Loading…
Cancel
Save