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;
namespace EC.App.Core
{
[ApiDescriptionSettings(false)]
[NonController]
[ApiDescriptionSettings(false)]
public class ApiController : IDynamicApiController
{
}

11
OnvifWebServer/Controllers/Onvif/CurdController.cs

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

3
OnvifWebServer/Controllers/Onvif/DeviceController.cs

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

17
OnvifWebServer/Controllers/Onvif/ImagingController.cs

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

3
OnvifWebServer/Controllers/Onvif/MediaController.cs

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

17
OnvifWebServer/Controllers/Onvif/PTZController.cs

@ -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;

3
OnvifWebServer/Controllers/Onvif/TestController.cs

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

Loading…
Cancel
Save