|
|
|
using Cis.Application.Core;
|
|
|
|
using Cis.Application.Core.Component.CameraSDK;
|
|
|
|
using Cis.Application.Core.Component.MarkSeacher;
|
|
|
|
using Cis.Application.Core.Component.Onvif;
|
|
|
|
using Cis.Application.Core.Component.PtzServer;
|
|
|
|
using Microsoft.AspNetCore.Builder;
|
|
|
|
using Microsoft.AspNetCore.Hosting;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
|
|
namespace Cis.Application;
|
|
|
|
|
|
|
|
[AppStartup(100)]
|
|
|
|
public class Startup : AppStartup
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// 配置应用所需服务,在该方法中可以添加应用所需要的功能或服务
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="services"></param>
|
|
|
|
public void ConfigureServices(IServiceCollection services)
|
|
|
|
{
|
|
|
|
services.AddConfigurableOptions<CameraDataOptions>();
|
|
|
|
|
|
|
|
services.AddSingleton<ICameraSdkServer, CameraSdkServer>();
|
|
|
|
services.AddSingleton<IOnvifServer, OnvifServer>();
|
|
|
|
services.AddSingleton<IMarkSearcherServer, MarkSearcherServer>();
|
|
|
|
services.AddSingleton(typeof(CameraDataCenter));
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 配置应用请求处理管道
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="app"></param>
|
|
|
|
/// <param name="env"></param>
|
|
|
|
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
|
|
|
{
|
|
|
|
InstanceCenter.Init();
|
|
|
|
}
|
|
|
|
}
|