Browse Source

update

master
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. 54
      OnvifWebServer/Properties/launchSettings.json
  5. 5
      OnvifWebServer/Startup.cs

2
OnvifWebServer/Controllers/Onvif/CurdController.cs

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

28
OnvifWebServer/Controllers/Onvif/PTZController.cs

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

54
OnvifWebServer/Properties/launchSettings.json

@ -1,29 +1,29 @@
{ {
"$schema": "http://json.schemastore.org/launchsettings.json", "$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": { "iisSettings": {
"windowsAuthentication": false, "windowsAuthentication": false,
"anonymousAuthentication": true, "anonymousAuthentication": true,
"iisExpress": { "iisExpress": {
"applicationUrl": "http://localhost:37315", "applicationUrl": "http://localhost:37315",
"sslPort": 44355 "sslPort": 44355
} }
}, },
"profiles": { "profiles": {
"IIS Express": { "IIS Express": {
"commandName": "IISExpress", "commandName": "IISExpress",
"launchBrowser": true, "launchBrowser": true,
"environmentVariables": { "environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development" "ASPNETCORE_ENVIRONMENT": "Development"
} }
}, },
"OnvifWebServer": { "OnvifWebServer": {
"commandName": "Project", "commandName": "Project",
"dotnetRunMessages": "true", "dotnetRunMessages": "true",
"launchBrowser": true, "launchBrowser": true,
"applicationUrl": "https://localhost:6001;http://localhost:6000", "applicationUrl": "http://localhost:10011;http://192.168.1.119:10011",
"environmentVariables": { "environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development" "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. // This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
services.AddCorsAccessor(); // Ìí¼Ó CORS ·þÎñ
services.AddControllers().AddInject().AddUnifyResult<RespParamProvider>(); // Ìí¼Ó AddInject(); services.AddControllers().AddInject().AddUnifyResult<RespParamProvider>(); // Ìí¼Ó AddInject();
} }
@ -30,7 +31,9 @@ namespace OnvifWebServer
app.UseDeveloperExceptionPage(); app.UseDeveloperExceptionPage();
} }
app.UseHttpsRedirection(); //app.UseHttpsRedirection();
app.UseCorsAccessor(); // Ìí¼Ó CORS ·þÎñ
app.UseRouting(); app.UseRouting();

Loading…
Cancel
Save