Skip to content

Commit 49e3ede

Browse files
committed
introduce application layer
1 parent a9ab8cf commit 49e3ede

File tree

7 files changed

+34
-18
lines changed

7 files changed

+34
-18
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<ItemGroup>
4+
<PackageReference Include="Microsoft.Extensions.Logging" />
5+
<PackageReference Include="System.IO.Ports" />
6+
</ItemGroup>
7+
8+
<ItemGroup>
9+
<ProjectReference Include="..\Bartendro.Data\Bartendro.Data.csproj" />
10+
</ItemGroup>
11+
12+
</Project>

api/Bartendro.Web/Services/PortService.cs renamed to api/Bartendro.Application/Services/PortService.cs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using System.Threading;
66
using Microsoft.Extensions.Logging;
77

8-
namespace Bartendro.Web.Services
8+
namespace Bartendro.Application.Services
99
{
1010
public class RouterDriver
1111
{
@@ -578,10 +578,7 @@ public int GetDispenserVersion(int dispenser)
578578

579579
public void SetStatusColor(int red, int green, int blue)
580580
{
581-
if (_softwareOnly)
582-
{
583-
return;
584-
}
581+
if (_softwareOnly) {}
585582

586583
// Assuming status is an instance of StatusLED
587584
// status.SetColor(red, green, blue);
@@ -648,10 +645,7 @@ public bool PatternFinish(int dispenser)
648645

649646
private void Sync(int state)
650647
{
651-
if (_softwareOnly)
652-
{
653-
return;
654-
}
648+
if (_softwareOnly) {}
655649

656650
// Assuming dispenserSelect is an instance of DispenserSelect
657651
// dispenserSelect.Sync(state);
@@ -848,7 +842,7 @@ private bool SendPacket32(int dest, int type, int val)
848842

849843
ack = PACKET_ACK_TIMEOUT;
850844
}
851-
845+
852846
var packet = Array.Empty<byte>();
853847

854848
if (ack == PACKET_ACK_OK)

api/Bartendro.Web/Services/SerialPortService.cs renamed to api/Bartendro.Application/Services/SerialPortService.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
using System.Collections.Generic;
1+
using System.Collections.Generic;
22
using System.IO.Ports;
33

4-
namespace Bartendro.Web.Services
4+
namespace Bartendro.Application.Services
55
{
6-
internal interface ISerialPortService
6+
public interface ISerialPortService
77
{
88
IEnumerable<string> GetPorts();
99
}

api/Bartendro.Web/Bartendro.Web.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</ItemGroup>
88

99
<ItemGroup>
10-
<ProjectReference Include="..\Bartendro.Database\Bartendro.Database.csproj" />
10+
<ProjectReference Include="..\Bartendro.Application\Bartendro.Application.csproj" />
1111
</ItemGroup>
1212

13-
</Project>
13+
</Project>

api/Bartendro.Web/Pages/Dispensers/List.razor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using System.Collections.Generic;
2-
using Bartendro.Web.Services;
1+
using System.Collections.Generic;
2+
using Bartendro.Application.Services;
33
using Microsoft.AspNetCore.Components;
44

55
namespace Bartendro.Web.Pages.Dispensers

api/Bartendro.sln

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
4-
VisualStudioVersion = 17.13.35919.96 d17.13
4+
VisualStudioVersion = 17.13.35919.96
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bartendro.Web", "Bartendro.Web\Bartendro.Web.csproj", "{10DB43C5-5AC4-4BE5-B698-E2E16F2429C6}"
77
EndProject
@@ -16,6 +16,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1616
Directory.Packages.props = Directory.Packages.props
1717
EndProjectSection
1818
EndProject
19+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bartendro.Application", "Bartendro.Application\Bartendro.Application.csproj", "{1E26BA72-9569-4259-A330-CD8DC7404B5A}"
20+
EndProject
1921
Global
2022
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2123
Debug|Any CPU = Debug|Any CPU
@@ -34,6 +36,10 @@ Global
3436
{5E245FBC-57DB-434E-B3F9-1809F1FF6C74}.Debug|Any CPU.Build.0 = Debug|Any CPU
3537
{5E245FBC-57DB-434E-B3F9-1809F1FF6C74}.Release|Any CPU.ActiveCfg = Release|Any CPU
3638
{5E245FBC-57DB-434E-B3F9-1809F1FF6C74}.Release|Any CPU.Build.0 = Release|Any CPU
39+
{1E26BA72-9569-4259-A330-CD8DC7404B5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
40+
{1E26BA72-9569-4259-A330-CD8DC7404B5A}.Debug|Any CPU.Build.0 = Debug|Any CPU
41+
{1E26BA72-9569-4259-A330-CD8DC7404B5A}.Release|Any CPU.ActiveCfg = Release|Any CPU
42+
{1E26BA72-9569-4259-A330-CD8DC7404B5A}.Release|Any CPU.Build.0 = Release|Any CPU
3743
EndGlobalSection
3844
GlobalSection(SolutionProperties) = preSolution
3945
HideSolutionNode = FALSE

api/Directory.Packages.props

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
<Project>
2+
23
<PropertyGroup>
34
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
45
<CentralPackageTransitivePinningEnabled>false</CentralPackageTransitivePinningEnabled>
56
</PropertyGroup>
7+
68
<ItemGroup>
79
<PackageVersion Include="Blazor.Extensions.Storage" Version="1.1.0-preview3" />
810
<PackageVersion Include="Blazored.FluentValidation" Version="2.2.0" />
911
<PackageVersion Include="FluentValidation" Version="11.11.0" />
1012
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.3" />
1113
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.3" />
1214
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="9.0.3" />
15+
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.3" />
1316
<PackageVersion Include="System.IO.Ports" Version="9.0.3" />
1417
</ItemGroup>
18+
1519
</Project>

0 commit comments

Comments
 (0)