Continue to modularize even more components

This commit is contained in:
Jeff Leung 2021-12-28 21:52:41 -08:00
parent c1b0d88b4c
commit 81f156475d
9 changed files with 40 additions and 12 deletions

View File

@ -1,6 +1,6 @@
using TwilioSMSReceiver.Data.Models; using TwilioSMSReceiver.Data.Models;
namespace TwilioSMSReceiver.Interfaces namespace TwilioSMSReceiver.Common.Interfaces
{ {
public interface IMessageHandler public interface IMessageHandler
{ {

View File

@ -1,8 +1,11 @@
#nullable disable #nullable disable
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using TwilioSMSReceiver.Common.Interfaces;
using TwilioSMSReceiver.Data; using TwilioSMSReceiver.Data;
using TwilioSMSReceiver.Data.Models; using TwilioSMSReceiver.Data.Models;
namespace TwilioSMSReceiver.Interfaces namespace TwilioSMSReceiver.Common.MessageHandlers
{ {
public abstract class BaseHandler : IMessageHandler public abstract class BaseHandler : IMessageHandler
{ {

View File

@ -1,7 +1,9 @@
using TwilioSMSReceiver.Data.Models; using TwilioSMSReceiver.Data.Models;
using TeamsHook.NET; using TeamsHook.NET;
using Microsoft.Extensions.Logging;
using TwilioSMSReceiver.Common.MessageHandlers;
namespace TwilioSMSReceiver.Interfaces namespace TwilioSMSReceiver.Common.Handlers
{ {
public class MSTeamsHandler : BaseHandler public class MSTeamsHandler : BaseHandler
{ {

View File

@ -1,6 +1,8 @@
using TwilioSMSReceiver.Data.Models; using Microsoft.Extensions.Logging;
using TwilioSMSReceiver.Common.MessageHandlers;
using TwilioSMSReceiver.Data.Models;
namespace TwilioSMSReceiver.Interfaces namespace TwilioSMSReceiver.Common.Handlers
{ {
public class SMTPHandler : BaseHandler public class SMTPHandler : BaseHandler
{ {

View File

@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="TeamsHook.NET" Version="0.1.0.18" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TwilioSMSReceiver.Data\TwilioSMSReceiver.Data.csproj" />
</ItemGroup>
</Project>

View File

@ -10,6 +10,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TwilioSMSReceiver", "Twilio
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TwilioSMSReceiver.Data", "TwilioSMSReceiver.Data\TwilioSMSReceiver.Data.csproj", "{642DADA5-E7A1-4754-A035-E2498C6CCF38}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TwilioSMSReceiver.Data", "TwilioSMSReceiver.Data\TwilioSMSReceiver.Data.csproj", "{642DADA5-E7A1-4754-A035-E2498C6CCF38}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TwilioSMSReceiver.Common", "TwilioSMSReceiver.Common\TwilioSMSReceiver.Common.csproj", "{09A6960F-AA69-4EF9-94DC-9BA5FDBB4E4A}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -24,6 +26,10 @@ Global
{642DADA5-E7A1-4754-A035-E2498C6CCF38}.Debug|Any CPU.Build.0 = Debug|Any CPU {642DADA5-E7A1-4754-A035-E2498C6CCF38}.Debug|Any CPU.Build.0 = Debug|Any CPU
{642DADA5-E7A1-4754-A035-E2498C6CCF38}.Release|Any CPU.ActiveCfg = Release|Any CPU {642DADA5-E7A1-4754-A035-E2498C6CCF38}.Release|Any CPU.ActiveCfg = Release|Any CPU
{642DADA5-E7A1-4754-A035-E2498C6CCF38}.Release|Any CPU.Build.0 = Release|Any CPU {642DADA5-E7A1-4754-A035-E2498C6CCF38}.Release|Any CPU.Build.0 = Release|Any CPU
{09A6960F-AA69-4EF9-94DC-9BA5FDBB4E4A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{09A6960F-AA69-4EF9-94DC-9BA5FDBB4E4A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{09A6960F-AA69-4EF9-94DC-9BA5FDBB4E4A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{09A6960F-AA69-4EF9-94DC-9BA5FDBB4E4A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View File

@ -10,7 +10,8 @@ using Twilio.AspNet.Common;
using TwilioSMSReceiver; using TwilioSMSReceiver;
using TwilioSMSReceiver.Data; using TwilioSMSReceiver.Data;
using TwilioSMSReceiver.Data.Models; using TwilioSMSReceiver.Data.Models;
using TwilioSMSReceiver.Interfaces; using TwilioSMSReceiver.Common.Interfaces;
using TwilioSMSReceiver.Common.Handlers;
namespace TwilioSMSReceiver.Controllers namespace TwilioSMSReceiver.Controllers
{ {

View File

@ -1,6 +1,7 @@
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using TwilioSMSReceiver; using TwilioSMSReceiver;
using TwilioSMSReceiver.Interfaces; using TwilioSMSReceiver.Common.Handlers;
using TwilioSMSReceiver.Common.Interfaces;
using TwilioSMSReceiver.Data; using TwilioSMSReceiver.Data;
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);

View File

@ -25,11 +25,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Migrations\" /> <ProjectReference Include="..\TwilioSMSReceiver.Common\TwilioSMSReceiver.Common.csproj" />
<Folder Include="Models\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TwilioSMSReceiver.Data\TwilioSMSReceiver.Data.csproj" /> <ProjectReference Include="..\TwilioSMSReceiver.Data\TwilioSMSReceiver.Data.csproj" />
</ItemGroup> </ItemGroup>