Browse Source

update

pull/1/head
fajiao 3 years ago
parent
commit
d581d7fc60
  1. 2
      OnvifWebServer/Controllers/Onvif/CurdController.cs
  2. 8
      OnvifWebServer/Controllers/Onvif/ImagingController.cs
  3. 28
      OnvifWebServer/Controllers/Onvif/PTZController.cs
  4. 2
      OnvifWebServer/Properties/launchSettings.json
  5. 5
      OnvifWebServer/Startup.cs

2
OnvifWebServer/Controllers/Onvif/CurdController.cs

@ -46,7 +46,7 @@ namespace OnvifWebServer.Controllers.Onvif
/// </summary>
/// <param name="ip">IP地址</param>
/// <returns></returns>
[HttpGet]
[HttpDelete]
public bool Remove(
[Required][DataValidation(ValidationTypes.IPv4)] string ip)
{

8
OnvifWebServer/Controllers/Onvif/ImagingController.cs

@ -44,7 +44,7 @@ namespace OnvifWebServer.Controllers.Onvif
/// <param name="ip"></param>
/// <param name="position"></param>
/// <returns></returns>
[HttpGet]
[HttpPost]
public async Task<bool> FocusAbsoluteMove(
[Required][DataValidation(ValidationTypes.IPv4)] string ip,
[Required] float position)
@ -59,7 +59,7 @@ namespace OnvifWebServer.Controllers.Onvif
/// <param name="ip"></param>
/// <param name="distance"></param>
/// <returns></returns>
[HttpGet]
[HttpPost]
public async Task<bool> FocusRelativeMove(
[Required][DataValidation(ValidationTypes.IPv4)] string ip,
[Required] float distance)
@ -74,7 +74,7 @@ namespace OnvifWebServer.Controllers.Onvif
/// <param name="ip"></param>
/// <param name="speed"></param>
/// <returns></returns>
[HttpGet]
[HttpPost]
public async Task<bool> FocusContinuousMove(
[Required][DataValidation(ValidationTypes.IPv4)] string ip,
[Required] float speed)
@ -87,7 +87,7 @@ namespace OnvifWebServer.Controllers.Onvif
/// 停止变焦
/// </summary>
/// <param name="ip">IP地址</param>
[HttpGet]
[HttpPost]
public async Task<bool> FocusStopMove(
[Required][DataValidation(ValidationTypes.IPv4)] string ip)
{

28
OnvifWebServer/Controllers/Onvif/PTZController.cs

@ -42,11 +42,11 @@ namespace OnvifWebServer.Controllers.Onvif
/// 绝对移动
/// </summary>
/// <param name="ip">IP地址</param>
/// <param name="pan">水平方向移动绝对点</param>
/// <param name="tilt">垂直方向移动绝对点</param>
/// <param name="zoom">变焦绝对点</param>
/// <param name="pan">水平方向移动绝对点[-1,1]</param>
/// <param name="tilt">垂直方向移动绝对点[-1,1]</param>
/// <param name="zoom">变倍绝对点[-1,1]</param>
/// <returns></returns>
[HttpGet]
[HttpPost]
public async Task<bool> AbsoluteMove(
[Required][DataValidation(ValidationTypes.IPv4)] string ip,
[Required] float pan, [Required] float tilt, [Required] float zoom)
@ -56,13 +56,13 @@ namespace OnvifWebServer.Controllers.Onvif
}
/// <summary>
/// 对移动
/// 对移动
/// </summary>
/// <param name="ip">IP地址</param>
/// <param name="pan">水平方向移动绝对点</param>
/// <param name="tilt">垂直方向移动绝对点</param>
/// <param name="zoom">变焦绝对点</param>
[HttpGet]
/// <param name="pan">水平方向移动相对点[-1,1]</param>
/// <param name="tilt">垂直方向移动相对点[-1,1]</param>
/// <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)
@ -75,10 +75,10 @@ namespace OnvifWebServer.Controllers.Onvif
/// 持续移动
/// </summary>
/// <param name="ip">IP地址</param>
/// <param name="pan">水平方向移动绝对点</param>
/// <param name="tilt">垂直方向移动绝对点</param>
/// <param name="zoom">变焦绝对点</param>
[HttpGet]
/// <param name="pan">水平方向移动速度[-1,1]</param>
/// <param name="tilt">垂直方向移动速度[-1,1]</param>
/// <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)
@ -91,7 +91,7 @@ namespace OnvifWebServer.Controllers.Onvif
/// 停止移动
/// </summary>
/// <param name="ip">IP地址</param>
[HttpGet]
[HttpPost]
public async Task<bool> StopMove(
[Required][DataValidation(ValidationTypes.IPv4)] string ip)
{

2
OnvifWebServer/Properties/launchSettings.json

@ -20,7 +20,7 @@
"commandName": "Project",
"dotnetRunMessages": "true",
"launchBrowser": true,
"applicationUrl": "https://localhost:6001;http://localhost:6000",
"applicationUrl": "http://localhost:10011;http://192.168.1.119:10011",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}

5
OnvifWebServer/Startup.cs

@ -19,6 +19,7 @@ namespace OnvifWebServer
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddCorsAccessor(); // Ìí¼Ó CORS ·þÎñ
services.AddControllers().AddInject().AddUnifyResult<RespParamProvider>(); // Ìí¼Ó AddInject();
}
@ -30,7 +31,9 @@ namespace OnvifWebServer
app.UseDeveloperExceptionPage();
}
app.UseHttpsRedirection();
//app.UseHttpsRedirection();
app.UseCorsAccessor(); // Ìí¼Ó CORS ·þÎñ
app.UseRouting();

Loading…
Cancel
Save