diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..3729ff0 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,25 @@ +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/azds.yaml +**/bin +**/charts +**/docker-compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md \ No newline at end of file diff --git a/Expedience.Api/Controllers/WeatherController.cs b/Expedience.Api/Controllers/WeatherController.cs deleted file mode 100644 index cc568d6..0000000 --- a/Expedience.Api/Controllers/WeatherController.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Microsoft.AspNetCore.Mvc; - -namespace Expedience.Api.Controllers -{ - [ApiController] - [Route("[controller]")] - public class WeatherForecastController : ControllerBase - { - private static readonly string[] Summaries = new[] - { - "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" - }; - - private readonly ILogger _logger; - - public WeatherForecastController(ILogger logger) - { - _logger = logger; - } - - [HttpGet(Name = "GetWeatherForecast")] - public IEnumerable Get() - { - return Enumerable.Range(1, 5).Select(index => new WeatherForecast - { - Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)), - TemperatureC = Random.Shared.Next(-20, 55), - Summary = Summaries[Random.Shared.Next(Summaries.Length)] - }) - .ToArray(); - } - } -} \ No newline at end of file diff --git a/Expedience.Api/Dockerfile b/Expedience.Api/Dockerfile index 3d9bf5b..74ec899 100644 --- a/Expedience.Api/Dockerfile +++ b/Expedience.Api/Dockerfile @@ -7,6 +7,7 @@ WORKDIR /src # Copy the project files COPY Expedience.Models/Expedience.Models.csproj Expedience.Models/ COPY Expedience.Api/Expedience.Api.csproj Expedience.Api/ +COPY Expedience.Api/Expedience.Infrastructure.csproj Expedience.Infrastructure/ # Restore the packages RUN dotnet restore Expedience.Api/Expedience.Api.csproj diff --git a/Expedience.Api/Encryption/Decryptor.cs b/Expedience.Api/Encryption/Decryptor.cs index e8a09c3..0cd60e6 100644 --- a/Expedience.Api/Encryption/Decryptor.cs +++ b/Expedience.Api/Encryption/Decryptor.cs @@ -1,7 +1,5 @@ -using RabbitMQ.Client; -using System.Reflection; +using System.Reflection; using System.Security.Cryptography; -using System.Security.Cryptography.Xml; using System.Text; namespace Expedience.Api.Encryption diff --git a/Expedience.Api/Expedience.Api.csproj b/Expedience.Api/Expedience.Api.csproj index 22d9d8d..4816cdf 100644 --- a/Expedience.Api/Expedience.Api.csproj +++ b/Expedience.Api/Expedience.Api.csproj @@ -17,20 +17,17 @@ + - + - + - - - - diff --git a/Expedience.Api/Program.cs b/Expedience.Api/Program.cs index a30ef53..f6fb5f5 100644 --- a/Expedience.Api/Program.cs +++ b/Expedience.Api/Program.cs @@ -1,16 +1,15 @@ using Expedience.Api.Consumers; -using Expedience.Api.Db; +using Expedience.Infrastructure; using Expedience.Api.Encryption; using MassTransit; using Microsoft.EntityFrameworkCore; -using System.Reflection; var builder = WebApplication.CreateBuilder(args); // Add services to the container. var connectionString = builder.Configuration.GetConnectionString("Expedience"); builder.Services.AddDbContext(options => - options.UseNpgsql(connectionString)); + options.UseNpgsql(connectionString).UseLowerCaseNamingConvention()); builder.Services.AddControllers(); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle diff --git a/Expedience.Api/Db/UserNameGenerator.cs b/Expedience.Api/UserNameGenerator.cs similarity index 99% rename from Expedience.Api/Db/UserNameGenerator.cs rename to Expedience.Api/UserNameGenerator.cs index 7c0c07f..4815bb5 100644 --- a/Expedience.Api/Db/UserNameGenerator.cs +++ b/Expedience.Api/UserNameGenerator.cs @@ -1,6 +1,6 @@ using System; -namespace Expedience.Api.Db +namespace Expedience.Api { public static class UserNameGenerator { diff --git a/Expedience.Api/WeatherForecast.cs b/Expedience.Api/WeatherForecast.cs deleted file mode 100644 index 3d760e2..0000000 --- a/Expedience.Api/WeatherForecast.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace Expedience.Api -{ - public class WeatherForecast - { - public DateOnly Date { get; set; } - - public int TemperatureC { get; set; } - - public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); - - public string? Summary { get; set; } - } -} \ No newline at end of file diff --git a/Expedience.Infrastructure/Expedience.Infrastructure.csproj b/Expedience.Infrastructure/Expedience.Infrastructure.csproj new file mode 100644 index 0000000..cddfd0f --- /dev/null +++ b/Expedience.Infrastructure/Expedience.Infrastructure.csproj @@ -0,0 +1,13 @@ + + + + net7.0 + enable + enable + + + + + + + diff --git a/Expedience.Api/Db/ExpedienceContext.cs b/Expedience.Infrastructure/ExpedienceContext.cs similarity index 94% rename from Expedience.Api/Db/ExpedienceContext.cs rename to Expedience.Infrastructure/ExpedienceContext.cs index eb6cbc1..7755169 100644 --- a/Expedience.Api/Db/ExpedienceContext.cs +++ b/Expedience.Infrastructure/ExpedienceContext.cs @@ -1,7 +1,7 @@ -using Expedience.Api.Db.Models; +using Expedience.Infrastructure.Models; using Microsoft.EntityFrameworkCore; -namespace Expedience.Api.Db +namespace Expedience.Infrastructure { public class ExpedienceContext : DbContext { diff --git a/Expedience.Infrastructure/Models/Duty.cs b/Expedience.Infrastructure/Models/Duty.cs new file mode 100644 index 0000000..378be68 --- /dev/null +++ b/Expedience.Infrastructure/Models/Duty.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Expedience.Infrastructure.Models +{ + public class Duty + { + public int Id { get; set; } + public string DutyName { get; set; } + public string DutyType { get; set; } + + } +} diff --git a/Expedience.Api/Db/Models/DutyCompletionResult.cs b/Expedience.Infrastructure/Models/DutyCompletionResult.cs similarity index 89% rename from Expedience.Api/Db/Models/DutyCompletionResult.cs rename to Expedience.Infrastructure/Models/DutyCompletionResult.cs index ca9419e..044ee3d 100644 --- a/Expedience.Api/Db/Models/DutyCompletionResult.cs +++ b/Expedience.Infrastructure/Models/DutyCompletionResult.cs @@ -1,4 +1,4 @@ -namespace Expedience.Api.Db.Models +namespace Expedience.Infrastructure.Models { public class DutyCompletionResult { @@ -16,7 +16,7 @@ public int Milliseconds { get; set; } public string GameVersion { get; set; } public string PluginVersion { get; set; } - public string Language { get; set; } + public string Lang { get; set; } public List DutyMembers { get; set; } public string DataCenter { get; set; } } diff --git a/Expedience.Api/Db/Models/DutyMember.cs b/Expedience.Infrastructure/Models/DutyMember.cs similarity index 90% rename from Expedience.Api/Db/Models/DutyMember.cs rename to Expedience.Infrastructure/Models/DutyMember.cs index 2105c2c..c4d9a17 100644 --- a/Expedience.Api/Db/Models/DutyMember.cs +++ b/Expedience.Infrastructure/Models/DutyMember.cs @@ -1,4 +1,4 @@ -namespace Expedience.Api.Db.Models +namespace Expedience.Infrastructure.Models { public class DutyMember { diff --git a/Expedience.Api/Db/Models/User.cs b/Expedience.Infrastructure/Models/User.cs similarity index 84% rename from Expedience.Api/Db/Models/User.cs rename to Expedience.Infrastructure/Models/User.cs index 5d8c1da..b0a9e2e 100644 --- a/Expedience.Api/Db/Models/User.cs +++ b/Expedience.Infrastructure/Models/User.cs @@ -1,4 +1,4 @@ -namespace Expedience.Api.Db.Models +namespace Expedience.Infrastructure.Models { public class User { diff --git a/Expedience.Models/CurrentDutyInfo.cs b/Expedience.Models/CurrentDutyInfo.cs index 0ead3ee..e61a331 100644 --- a/Expedience.Models/CurrentDutyInfo.cs +++ b/Expedience.Models/CurrentDutyInfo.cs @@ -15,7 +15,7 @@ namespace Expedience.Models private Stopwatch _stopwatch; public PlayerInfo Player { get; set; } public int DutyId { get; set; } - public string PlaceName { get; set; } + public string DutyName { get; set; } public List PartyMembers { get; set; } = new (); public DateTime StartTime { get; } public DateTime EndTime { get; private set; } @@ -23,7 +23,7 @@ namespace Expedience.Models public bool HasNpcMembers { get; set; } public bool HasEcho { get; set; } public string DataCenter { get; set; } - + public void EndDuty() { _stopwatch.Stop(); diff --git a/Expedience.Models/DutyCompletionResult.cs b/Expedience.Models/DutyCompletionResult.cs index 4327de1..912255c 100644 --- a/Expedience.Models/DutyCompletionResult.cs +++ b/Expedience.Models/DutyCompletionResult.cs @@ -16,7 +16,7 @@ namespace Expedience.Models DutyInfo = new DutyInfo { DutyId = currentDuty.DutyId, - DutyName = currentDuty.PlaceName, + DutyName = currentDuty.DutyName, IsUnrestricted = currentDuty.IsUnrestricted, IsNpcSupported = currentDuty.PartyMembers.Any(p => p.IsNpc), HasEcho = currentDuty.HasEcho, diff --git a/Expedience.sln b/Expedience.sln index a7b196a..484f388 100644 --- a/Expedience.sln +++ b/Expedience.sln @@ -3,18 +3,74 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.5.33424.131 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Expedience", "Expedience.csproj", "{8F1BDDC2-28F2-4CE2-8FB0-8FC58B4F6D9F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Expedience.Plugin", "Expedience.Plugin\Expedience.Plugin.csproj", "{8F1BDDC2-28F2-4CE2-8FB0-8FC58B4F6D9F}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Expedience.Api", "Expedience.Api\Expedience.Api.csproj", "{B385491B-A14F-4971-8486-66146592794A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Expedience.Models", "Expedience.Models\Expedience.Models.csproj", "{1775D9CD-9FD3-4433-8D0A-C405EA8D7E46}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApp", "TestApp\TestApp.csproj", "{04E95950-527E-46BC-9A4D-08587AA1B7DA}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Expedience.Web", "Expedience.Web\Expedience.Web.csproj", "{F0C4E623-C9D0-470A-A7CE-423D84261C82}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Expedience.Infrastructure", "Expedience.Infrastructure\Expedience.Infrastructure.csproj", "{22193E16-7B41-44A7-8A40-523963CF2963}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU Debug|x64 = Debug|x64 + Release|Any CPU = Release|Any CPU Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8F1BDDC2-28F2-4CE2-8FB0-8FC58B4F6D9F}.Debug|Any CPU.ActiveCfg = Debug|x64 + {8F1BDDC2-28F2-4CE2-8FB0-8FC58B4F6D9F}.Debug|Any CPU.Build.0 = Debug|x64 {8F1BDDC2-28F2-4CE2-8FB0-8FC58B4F6D9F}.Debug|x64.ActiveCfg = Debug|x64 {8F1BDDC2-28F2-4CE2-8FB0-8FC58B4F6D9F}.Debug|x64.Build.0 = Debug|x64 + {8F1BDDC2-28F2-4CE2-8FB0-8FC58B4F6D9F}.Release|Any CPU.ActiveCfg = Release|x64 + {8F1BDDC2-28F2-4CE2-8FB0-8FC58B4F6D9F}.Release|Any CPU.Build.0 = Release|x64 {8F1BDDC2-28F2-4CE2-8FB0-8FC58B4F6D9F}.Release|x64.ActiveCfg = Release|x64 {8F1BDDC2-28F2-4CE2-8FB0-8FC58B4F6D9F}.Release|x64.Build.0 = Release|x64 + {B385491B-A14F-4971-8486-66146592794A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B385491B-A14F-4971-8486-66146592794A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B385491B-A14F-4971-8486-66146592794A}.Debug|x64.ActiveCfg = Debug|Any CPU + {B385491B-A14F-4971-8486-66146592794A}.Debug|x64.Build.0 = Debug|Any CPU + {B385491B-A14F-4971-8486-66146592794A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B385491B-A14F-4971-8486-66146592794A}.Release|Any CPU.Build.0 = Release|Any CPU + {B385491B-A14F-4971-8486-66146592794A}.Release|x64.ActiveCfg = Release|Any CPU + {B385491B-A14F-4971-8486-66146592794A}.Release|x64.Build.0 = Release|Any CPU + {1775D9CD-9FD3-4433-8D0A-C405EA8D7E46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1775D9CD-9FD3-4433-8D0A-C405EA8D7E46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1775D9CD-9FD3-4433-8D0A-C405EA8D7E46}.Debug|x64.ActiveCfg = Debug|Any CPU + {1775D9CD-9FD3-4433-8D0A-C405EA8D7E46}.Debug|x64.Build.0 = Debug|Any CPU + {1775D9CD-9FD3-4433-8D0A-C405EA8D7E46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1775D9CD-9FD3-4433-8D0A-C405EA8D7E46}.Release|Any CPU.Build.0 = Release|Any CPU + {1775D9CD-9FD3-4433-8D0A-C405EA8D7E46}.Release|x64.ActiveCfg = Release|Any CPU + {1775D9CD-9FD3-4433-8D0A-C405EA8D7E46}.Release|x64.Build.0 = Release|Any CPU + {04E95950-527E-46BC-9A4D-08587AA1B7DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {04E95950-527E-46BC-9A4D-08587AA1B7DA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {04E95950-527E-46BC-9A4D-08587AA1B7DA}.Debug|x64.ActiveCfg = Debug|Any CPU + {04E95950-527E-46BC-9A4D-08587AA1B7DA}.Debug|x64.Build.0 = Debug|Any CPU + {04E95950-527E-46BC-9A4D-08587AA1B7DA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {04E95950-527E-46BC-9A4D-08587AA1B7DA}.Release|Any CPU.Build.0 = Release|Any CPU + {04E95950-527E-46BC-9A4D-08587AA1B7DA}.Release|x64.ActiveCfg = Release|Any CPU + {04E95950-527E-46BC-9A4D-08587AA1B7DA}.Release|x64.Build.0 = Release|Any CPU + {F0C4E623-C9D0-470A-A7CE-423D84261C82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F0C4E623-C9D0-470A-A7CE-423D84261C82}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F0C4E623-C9D0-470A-A7CE-423D84261C82}.Debug|x64.ActiveCfg = Debug|Any CPU + {F0C4E623-C9D0-470A-A7CE-423D84261C82}.Debug|x64.Build.0 = Debug|Any CPU + {F0C4E623-C9D0-470A-A7CE-423D84261C82}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F0C4E623-C9D0-470A-A7CE-423D84261C82}.Release|Any CPU.Build.0 = Release|Any CPU + {F0C4E623-C9D0-470A-A7CE-423D84261C82}.Release|x64.ActiveCfg = Release|Any CPU + {F0C4E623-C9D0-470A-A7CE-423D84261C82}.Release|x64.Build.0 = Release|Any CPU + {22193E16-7B41-44A7-8A40-523963CF2963}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {22193E16-7B41-44A7-8A40-523963CF2963}.Debug|Any CPU.Build.0 = Debug|Any CPU + {22193E16-7B41-44A7-8A40-523963CF2963}.Debug|x64.ActiveCfg = Debug|Any CPU + {22193E16-7B41-44A7-8A40-523963CF2963}.Debug|x64.Build.0 = Debug|Any CPU + {22193E16-7B41-44A7-8A40-523963CF2963}.Release|Any CPU.ActiveCfg = Release|Any CPU + {22193E16-7B41-44A7-8A40-523963CF2963}.Release|Any CPU.Build.0 = Release|Any CPU + {22193E16-7B41-44A7-8A40-523963CF2963}.Release|x64.ActiveCfg = Release|Any CPU + {22193E16-7B41-44A7-8A40-523963CF2963}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE