main
ilitirit 3 years ago
parent ccee481275
commit 3b1a56426a

@ -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

@ -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<WeatherForecastController> _logger;
public WeatherForecastController(ILogger<WeatherForecastController> logger)
{
_logger = logger;
}
[HttpGet(Name = "GetWeatherForecast")]
public IEnumerable<WeatherForecast> 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();
}
}
}

@ -7,6 +7,7 @@ WORKDIR /src
# Copy the project files # Copy the project files
COPY Expedience.Models/Expedience.Models.csproj Expedience.Models/ COPY Expedience.Models/Expedience.Models.csproj Expedience.Models/
COPY Expedience.Api/Expedience.Api.csproj Expedience.Api/ COPY Expedience.Api/Expedience.Api.csproj Expedience.Api/
COPY Expedience.Api/Expedience.Infrastructure.csproj Expedience.Infrastructure/
# Restore the packages # Restore the packages
RUN dotnet restore Expedience.Api/Expedience.Api.csproj RUN dotnet restore Expedience.Api/Expedience.Api.csproj

@ -1,7 +1,5 @@
using RabbitMQ.Client; using System.Reflection;
using System.Reflection;
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Security.Cryptography.Xml;
using System.Text; using System.Text;
namespace Expedience.Api.Encryption namespace Expedience.Api.Encryption

@ -17,20 +17,17 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="EFCore.NamingConventions" Version="7.0.2" />
<PackageReference Include="MassTransit.RabbitMQ" Version="8.0.14" /> <PackageReference Include="MassTransit.RabbitMQ" Version="8.0.14" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.4" /> <PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.5" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.3" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Expedience.Infrastructure\Expedience.Infrastructure.csproj" />
<ProjectReference Include="..\Expedience.Models\Expedience.Models.csproj" /> <ProjectReference Include="..\Expedience.Models\Expedience.Models.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Db\Repositories\" />
</ItemGroup>
</Project> </Project>

@ -1,16 +1,15 @@
using Expedience.Api.Consumers; using Expedience.Api.Consumers;
using Expedience.Api.Db; using Expedience.Infrastructure;
using Expedience.Api.Encryption; using Expedience.Api.Encryption;
using MassTransit; using MassTransit;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using System.Reflection;
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);
// Add services to the container. // Add services to the container.
var connectionString = builder.Configuration.GetConnectionString("Expedience"); var connectionString = builder.Configuration.GetConnectionString("Expedience");
builder.Services.AddDbContext<ExpedienceContext>(options => builder.Services.AddDbContext<ExpedienceContext>(options =>
options.UseNpgsql(connectionString)); options.UseNpgsql(connectionString).UseLowerCaseNamingConvention());
builder.Services.AddControllers(); builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle

@ -1,6 +1,6 @@
using System; using System;
namespace Expedience.Api.Db namespace Expedience.Api
{ {
public static class UserNameGenerator public static class UserNameGenerator
{ {

@ -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; }
}
}

@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.3" />
</ItemGroup>
</Project>

@ -1,7 +1,7 @@
using Expedience.Api.Db.Models; using Expedience.Infrastructure.Models;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
namespace Expedience.Api.Db namespace Expedience.Infrastructure
{ {
public class ExpedienceContext : DbContext public class ExpedienceContext : DbContext
{ {

@ -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; }
}
}

@ -1,4 +1,4 @@
namespace Expedience.Api.Db.Models namespace Expedience.Infrastructure.Models
{ {
public class DutyCompletionResult public class DutyCompletionResult
{ {
@ -16,7 +16,7 @@
public int Milliseconds { get; set; } public int Milliseconds { get; set; }
public string GameVersion { get; set; } public string GameVersion { get; set; }
public string PluginVersion { get; set; } public string PluginVersion { get; set; }
public string Language { get; set; } public string Lang { get; set; }
public List<DutyMember> DutyMembers { get; set; } public List<DutyMember> DutyMembers { get; set; }
public string DataCenter { get; set; } public string DataCenter { get; set; }
} }

@ -1,4 +1,4 @@
namespace Expedience.Api.Db.Models namespace Expedience.Infrastructure.Models
{ {
public class DutyMember public class DutyMember
{ {

@ -1,4 +1,4 @@
namespace Expedience.Api.Db.Models namespace Expedience.Infrastructure.Models
{ {
public class User public class User
{ {

@ -15,7 +15,7 @@ namespace Expedience.Models
private Stopwatch _stopwatch; private Stopwatch _stopwatch;
public PlayerInfo Player { get; set; } public PlayerInfo Player { get; set; }
public int DutyId { get; set; } public int DutyId { get; set; }
public string PlaceName { get; set; } public string DutyName { get; set; }
public List<GroupMemberInfo> PartyMembers { get; set; } = new (); public List<GroupMemberInfo> PartyMembers { get; set; } = new ();
public DateTime StartTime { get; } public DateTime StartTime { get; }
public DateTime EndTime { get; private set; } public DateTime EndTime { get; private set; }
@ -23,7 +23,7 @@ namespace Expedience.Models
public bool HasNpcMembers { get; set; } public bool HasNpcMembers { get; set; }
public bool HasEcho { get; set; } public bool HasEcho { get; set; }
public string DataCenter { get; set; } public string DataCenter { get; set; }
public void EndDuty() public void EndDuty()
{ {
_stopwatch.Stop(); _stopwatch.Stop();

@ -16,7 +16,7 @@ namespace Expedience.Models
DutyInfo = new DutyInfo DutyInfo = new DutyInfo
{ {
DutyId = currentDuty.DutyId, DutyId = currentDuty.DutyId,
DutyName = currentDuty.PlaceName, DutyName = currentDuty.DutyName,
IsUnrestricted = currentDuty.IsUnrestricted, IsUnrestricted = currentDuty.IsUnrestricted,
IsNpcSupported = currentDuty.PartyMembers.Any(p => p.IsNpc), IsNpcSupported = currentDuty.PartyMembers.Any(p => p.IsNpc),
HasEcho = currentDuty.HasEcho, HasEcho = currentDuty.HasEcho,

@ -3,18 +3,74 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17 # Visual Studio Version 17
VisualStudioVersion = 17.5.33424.131 VisualStudioVersion = 17.5.33424.131
MinimumVisualStudioVersion = 10.0.40219.1 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 EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64 Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64 Release|x64 = Release|x64
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution 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.ActiveCfg = Debug|x64
{8F1BDDC2-28F2-4CE2-8FB0-8FC58B4F6D9F}.Debug|x64.Build.0 = 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.ActiveCfg = Release|x64
{8F1BDDC2-28F2-4CE2-8FB0-8FC58B4F6D9F}.Release|x64.Build.0 = 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 EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

Loading…
Cancel
Save