Exemple #1
0
 public ImportacaoAssociadosAppService(
     IUnitOfWork unitOfWork,
     IExcelService excelService,
     IMapper mapper,
     IImportacaoServiceConfiguration importacaoConfiguration,
     IProgressoImportacaoEvent progressoEvent) : base(unitOfWork, excelService, mapper, importacaoConfiguration, progressoEvent)
 {
 }
 public ImportacaoAppService(
     IUnitOfWork unitOfWork,
     IExcelService excelService,
     IImportacaoServiceConfiguration importacaoConfiguration,
     IProgressoImportacaoEvent progressoEvent) : base(unitOfWork, unitOfWork.ImportacaoRepository)
 {
     _excelService         = excelService;
     _dataColumnValidators = importacaoConfiguration.Validators;
     _progressoEvent       = progressoEvent;
 }
Exemple #3
0
 protected ImportacaoAppService(
     IUnitOfWork unitOfWork,
     IExcelService excelService,
     IMapper mapper,
     IImportacaoServiceConfiguration importacaoConfiguration,
     IProgressoImportacaoEvent progressoEvent) : base(unitOfWork, unitOfWork.ImportacaoRepository, mapper, "Importação", 'a')
 {
     _excelService         = excelService;
     _dataColumnValidators = importacaoConfiguration.Validators;
     _progressoEvent       = progressoEvent;
 }
Exemple #4
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(
            IApplicationBuilder app,
            IHostingEnvironment env,
            IHubContext <ProgressHub> hubContext,
            IProgressoImportacaoEvent notificacaoProgressoEvent,
            IMapper mapper)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }


            app.UseCors("AllowAll");
            app.UseSignalR(routes =>
            {
                routes.MapHub <ProgressHub>("/api/signalr");
            });
            app.UseAuthentication();

            app.UseHttpErrorMiddleware();


            notificacaoProgressoEvent.NotificacaoProgresso += (object sender, ProgressoImportacaoEventArgs args) =>
            {
                hubContext.Clients.User(args.CPFUsuario).SendAsync("progressoimportacao", args);
            };

            notificacaoProgressoEvent.ImportacaoFinalizada += (object sender, FinalizacaoImportacaoStatusEventArgs args) =>
            {
                hubContext.Clients.User(args.CPFUsuario).SendAsync("importacaofinalizada", mapper.Map <FinalizacaoImportacaoStatusViewModel>(args));
            };

            //app.UseHttpsRedirection();
            app.UseMvc();
        }
Exemple #5
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(
            IApplicationBuilder app,
            IHubContext <ProgressHub> hubContext,
            IProgressoImportacaoEvent notificacaoProgressoEvent,
            IMapper mapper)
        {
            app.UseForwardedHeaders();
            app.UseCors("AllowAll");

            app.UseHttpErrorMiddleware();

            // app.UseHsts();

            notificacaoProgressoEvent.NotificacaoProgresso += (object sender, ProgressoImportacaoEventArgs args) =>
            {
                hubContext.Clients.User(args.EmailUsuario).SendAsync("progressoimportacao", args);
            };

            notificacaoProgressoEvent.ImportacaoFinalizada += (object sender, FinalizacaoImportacaoStatusEventArgs args) =>
            {
                hubContext.Clients.User(args.EmailUsuario).SendAsync("importacaofinalizada", mapper.Map <FinalizacaoImportacaoStatusViewModel>(args));
            };

            var options = new RewriteOptions().AddRewrite(@"^((?!.*?\b(web$.*|health.*|api\/.*)))((\w+))*\/?(\.\w{{5,}})?\??([^.]+)?$", "index.html", false);

            app.UseRewriter(options);

            app.UseResponseCompression();
            app.UseDefaultFiles();
            app.UseStaticFiles();
            app.UseRouting();
            app.UseAuthentication();
            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
                endpoints.MapHub <ProgressHub>("/api/signalr");
            });
        }