Skip to content

Commit

Permalink
Modules for reports
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryba1986 committed Jul 4, 2022
1 parent 5f5141f commit 87c17b0
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 1 deletion.
21 changes: 21 additions & 0 deletions src/Zeus.Infrastructure/Configuration/Modules/PlcModule.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using Autofac;
using Zeus.Enums.Plcs;
using Zeus.Infrastructure.Plc;
using Zeus.Infrastructure.Plc.Base;

namespace Zeus.Infrastructure.Configuration.Modules
{
internal sealed class PlcModule : Module
{
protected override void Load(ContainerBuilder builder)
{
builder
.RegisterType<MeterPlcProcessor>()
.Keyed<IPlcProcessor>(PlcType.Meter);

builder
.RegisterType<Rvd145PlcProcessor>()
.Keyed<IPlcProcessor>(PlcType.Rvd145);
}
}
}
29 changes: 29 additions & 0 deletions src/Zeus.Infrastructure/Configuration/Modules/ReportModule.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using Autofac;
using Zeus.Enums.Reports;
using Zeus.Infrastructure.Reports;
using Zeus.Infrastructure.Reports.Base;

namespace Zeus.Infrastructure.Configuration.Modules
{
internal sealed class ReportModule : Module
{
protected override void Load(ContainerBuilder builder)
{
builder
.RegisterType<DayReportProcessor>()
.Keyed<IReportProcessor>(ReportType.Day);

builder
.RegisterType<MonthReportProcessor>()
.Keyed<IReportProcessor>(ReportType.Month);

builder
.RegisterType<YearReportProcessor>()
.Keyed<IReportProcessor>(ReportType.Year);

builder
.RegisterType<DayOfYearReportProcessor>()
.Keyed<IReportProcessor>(ReportType.DayOfYear);
}
}
}
4 changes: 3 additions & 1 deletion src/Zeus.Infrastructure/Configuration/ZeusModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ private void RegisterMappers(ContainerBuilder builder)

private void RegisterModules(ContainerBuilder builder)
{
builder.RegisterModule<MediatorModule>();
builder.RegisterModule<MongoModule>();
builder.RegisterModule<PlcModule>();
builder.RegisterModule<ReportModule>();
builder.RegisterModule<MediatorModule>();
builder.RegisterModule(new SettingsModule(_configuration));
}
}
Expand Down

0 comments on commit 87c17b0

Please sign in to comment.