generated from Game-as-a-Service/Gaas-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove unused code and update method implementation
- Loading branch information
Showing
25 changed files
with
110 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,4 @@ public interface IRepository | |
Task SaveAsync(Game game); | ||
void Save(Game game); | ||
|
||
|
||
void Initialize(); | ||
} |
13 changes: 13 additions & 0 deletions
13
src/BackEnd/src/Infrastructure/InMemory/DependencyInjection.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Wsa.Gaas.Werewolf.Application.Common; | ||
|
||
namespace Wsa.Gaas.Werewolf.InMemory; | ||
public static class DependencyInjection | ||
{ | ||
public static IServiceCollection AddInMemoryRepository(this IServiceCollection services) | ||
{ | ||
services.AddSingleton<IRepository, InMemoryRepository>(); | ||
|
||
return services; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/BackEnd/src/Infrastructure/InMemory/Wsa.Gaas.Werewolf.InMemory.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\Core\Application\Wsa.Gaas.Werewolf.Application.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 1 addition & 18 deletions
19
src/BackEnd/src/Presentation/WebApi/Endpoints/ConfirmPlayerRoleEndpoint.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,10 @@ | ||
using Wsa.Gaas.Werewolf.WebApi.Common; | ||
|
||
namespace Wsa.Gaas.Werewolf.WebApi.Endpoints; | ||
namespace Wsa.Gaas.Werewolf.WebApi.Endpoints; | ||
|
||
public class ConfirmPlayerRoleEndpoint : WebApiEndpoint<ConfirmPlayerRoleRequest, ConfirmPlayerRoleResponse> | ||
{ | ||
/// <summary> | ||
/// Register API Route | ||
/// </summary> | ||
public override void Configure() | ||
{ | ||
Get("/games/{DiscordVoiceChannelId}/players/{PlayerId}/Role"); | ||
AllowAnonymous(); | ||
} | ||
|
||
/// <summary> | ||
/// api request | ||
/// </summary> | ||
/// <param name="req"></param> | ||
/// <param name="ct"></param> | ||
/// <returns></returns> | ||
public async override Task<ConfirmPlayerRoleResponse> ExecuteAsync(ConfirmPlayerRoleRequest req, CancellationToken ct) | ||
{ | ||
return await UseCase.ExecuteAsync(req, ct); | ||
} | ||
|
||
} |
9 changes: 1 addition & 8 deletions
9
src/BackEnd/src/Presentation/WebApi/Endpoints/CreateGameEndpoint.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,9 @@ | ||
using Wsa.Gaas.Werewolf.WebApi.Common; | ||
|
||
namespace Wsa.Gaas.Werewolf.WebApi.Endpoints; | ||
namespace Wsa.Gaas.Werewolf.WebApi.Endpoints; | ||
public class CreateGameEndpoint : WebApiEndpoint<CreateGameRequest, CreateGameResponse> | ||
{ | ||
public override void Configure() | ||
{ | ||
Post("/games"); | ||
AllowAnonymous(); | ||
} | ||
|
||
public override async Task<CreateGameResponse> ExecuteAsync(CreateGameRequest req, CancellationToken ct) | ||
{ | ||
return await UseCase.ExecuteAsync(req, ct); | ||
} | ||
} |
9 changes: 1 addition & 8 deletions
9
src/BackEnd/src/Presentation/WebApi/Endpoints/DiscoverPlayerRoleEndpoint.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,9 @@ | ||
using Wsa.Gaas.Werewolf.WebApi.Common; | ||
|
||
namespace Wsa.Gaas.Werewolf.WebApi.Endpoints; | ||
namespace Wsa.Gaas.Werewolf.WebApi.Endpoints; | ||
public class DiscoverPlayerRoleEndpoint : WebApiEndpoint<DiscoverPlayerRoleRequest, DiscoverPlayerRoleResponse> | ||
{ | ||
public override void Configure() | ||
{ | ||
Post("/games/{DiscordVoiceChannelId}/players/{PlayerId}/DiscoverRole"); | ||
AllowAnonymous(); | ||
} | ||
|
||
public override async Task<DiscoverPlayerRoleResponse> ExecuteAsync(DiscoverPlayerRoleRequest req, CancellationToken ct) | ||
{ | ||
return await UseCase.ExecuteAsync(req, ct); | ||
} | ||
} |
9 changes: 1 addition & 8 deletions
9
src/BackEnd/src/Presentation/WebApi/Endpoints/EndGameEndpoint.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,9 @@ | ||
using Wsa.Gaas.Werewolf.WebApi.Common; | ||
|
||
namespace Wsa.Gaas.Werewolf.WebApi.Endpoints; | ||
namespace Wsa.Gaas.Werewolf.WebApi.Endpoints; | ||
public class EndGameEndpoint : WebApiEndpoint<EndGameRequest, EndGameResponse> | ||
{ | ||
public override void Configure() | ||
{ | ||
Post("/games/{DiscordVoiceChannelId}/end"); | ||
AllowAnonymous(); | ||
} | ||
|
||
public override async Task<EndGameResponse> ExecuteAsync(EndGameRequest req, CancellationToken ct) | ||
{ | ||
return await UseCase.ExecuteAsync(req, ct); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 1 addition & 8 deletions
9
src/BackEnd/src/Presentation/WebApi/Endpoints/StartGameEndpoint.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,9 @@ | ||
using Wsa.Gaas.Werewolf.WebApi.Common; | ||
|
||
namespace Wsa.Gaas.Werewolf.WebApi.Endpoints; | ||
namespace Wsa.Gaas.Werewolf.WebApi.Endpoints; | ||
public class StartGameEndpoint : WebApiEndpoint<StartGameRequest, StartGameResponse> | ||
{ | ||
public override void Configure() | ||
{ | ||
Post("/games/{DiscordVoiceChannelId}/start"); | ||
AllowAnonymous(); | ||
} | ||
|
||
public override async Task<StartGameResponse> ExecuteAsync(StartGameRequest req, CancellationToken ct) | ||
{ | ||
return await UseCase.ExecuteAsync(req, ct); | ||
} | ||
} |
9 changes: 1 addition & 8 deletions
9
src/BackEnd/src/Presentation/WebApi/Endpoints/WerewolfVoteEndpoint.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,9 @@ | ||
using Wsa.Gaas.Werewolf.WebApi.Common; | ||
|
||
namespace Wsa.Gaas.Werewolf.WebApi.Endpoints; | ||
namespace Wsa.Gaas.Werewolf.WebApi.Endpoints; | ||
public class WerewolfVoteEndpoint : WebApiEndpoint<WerewolfVoteRequest, WerewolfVoteResponse> | ||
{ | ||
public override void Configure() | ||
{ | ||
Post("/games/{DiscordChannelId}/werewolf/vote"); | ||
AllowAnonymous(); | ||
} | ||
|
||
public override async Task<WerewolfVoteResponse> ExecuteAsync(WerewolfVoteRequest req, CancellationToken ct) | ||
{ | ||
return await UseCase.ExecuteAsync(req, ct); | ||
} | ||
} |
9 changes: 1 addition & 8 deletions
9
src/BackEnd/src/Presentation/WebApi/Endpoints/WitchUseAntidoteEndpoint.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,11 @@ | ||
using Wsa.Gaas.Werewolf.WebApi.Common; | ||
|
||
namespace Wsa.Gaas.Werewolf.WebApi.Endpoints; | ||
namespace Wsa.Gaas.Werewolf.WebApi.Endpoints; | ||
public class WitchUseAntidoteEndpoint : WebApiEndpoint<WitchUseAntidoteRequest, WitchUseAntidoteResponse> | ||
{ | ||
public override void Configure() | ||
{ | ||
Post("/games/{DiscordVoiceChannelId}/players/{playerId}:useAnitdote"); | ||
AllowAnonymous(); | ||
} | ||
|
||
public override async Task<WitchUseAntidoteResponse> ExecuteAsync(WitchUseAntidoteRequest req, CancellationToken ct) | ||
{ | ||
return await UseCase.ExecuteAsync(req, ct); | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 0 additions & 38 deletions
38
src/BackEnd/src/Presentation/WebApi/Extensions/ExceptionHandlerExtensions.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.