Commit 42c72dd6 authored by Patrick Stalljohann's avatar Patrick Stalljohann
Browse files

remove dependency to apiMessageLibrary and split up contract projects

parent fa62810d
......@@ -94,9 +94,9 @@ publish-services-dev:
variables:
IMAGE_TAG: latest-dev
script:
- docker buildx build -t $IMAGE_PREFIX/matchmanager:$IMAGE_TAG -f MatchManager/Dockerfile --platform linux/arm64,linux/amd64 --push .
- docker buildx build -t $IMAGE_PREFIX/gamemanager:$IMAGE_TAG -f GameManager/Dockerfile --platform linux/arm64,linux/amd64 --push .
- docker buildx build -t $IMAGE_PREFIX/botmanager:$IMAGE_TAG -f BotManager/Dockerfile --platform linux/arm64,linux/amd64 --push .
- docker buildx build -t $IMAGE_PREFIX/matchmanager:$IMAGE_TAG -f Matches.Manager/Dockerfile --platform linux/arm64,linux/amd64 --push .
- docker buildx build -t $IMAGE_PREFIX/gamemanager:$IMAGE_TAG -f Games.Manager/Dockerfile --platform linux/arm64,linux/amd64 --push .
- docker buildx build -t $IMAGE_PREFIX/botmanager:$IMAGE_TAG -f Bots.Manager/Dockerfile --platform linux/arm64,linux/amd64 --push .
- docker buildx build -t $IMAGE_PREFIX/usermanager:$IMAGE_TAG -f UserManager/Dockerfile --platform linux/arm64,linux/amd64 --push .
- docker buildx build -t $IMAGE_PREFIX/tournamentsystemmanager:$IMAGE_TAG -f TournamentSystemManager/Dockerfile --platform linux/arm64,linux/amd64 --push .
- docker buildx build -t $IMAGE_PREFIX/tournamentmanager:$IMAGE_TAG -f TournamentManager/Dockerfile --platform linux/arm64,linux/amd64 --push .
......@@ -110,7 +110,7 @@ publish-connectors-dev:
variables:
IMAGE_TAG: latest-dev
script:
- docker buildx build -t $IMAGE_PREFIX/signalrbot:$IMAGE_TAG -f BotSignal/Dockerfile --platform linux/arm64,linux/amd64 --push .
- docker buildx build -t $IMAGE_PREFIX/signalrbot:$IMAGE_TAG -f Bots.Signal/Dockerfile --platform linux/arm64,linux/amd64 --push .
- docker buildx build -t $IMAGE_PREFIX/signalrgui:$IMAGE_TAG -f GuiSignal/Dockerfile --platform linux/arm64,linux/amd64 --push .
only:
- master
......@@ -131,9 +131,9 @@ publish-services-release:
variables:
IMAGE_TAG: latest
script:
- docker buildx build -t $IMAGE_PREFIX/matchmanager:$IMAGE_TAG -f MatchManager/Dockerfile --platform linux/arm64,linux/amd64 --push .
- docker buildx build -t $IMAGE_PREFIX/gamemanager:$IMAGE_TAG -f GameManager/Dockerfile --platform linux/arm64,linux/amd64 --push .
- docker buildx build -t $IMAGE_PREFIX/botmanager:$IMAGE_TAG -f BotManager/Dockerfile --platform linux/arm64,linux/amd64 --push .
- docker buildx build -t $IMAGE_PREFIX/matchmanager:$IMAGE_TAG -f Matches.Manager/Dockerfile --platform linux/arm64,linux/amd64 --push .
- docker buildx build -t $IMAGE_PREFIX/gamemanager:$IMAGE_TAG -f Games.Manager/Dockerfile --platform linux/arm64,linux/amd64 --push .
- docker buildx build -t $IMAGE_PREFIX/botmanager:$IMAGE_TAG -f Bots.Manager/Dockerfile --platform linux/arm64,linux/amd64 --push .
- docker buildx build -t $IMAGE_PREFIX/usermanager:$IMAGE_TAG -f UserManager/Dockerfile --platform linux/arm64,linux/amd64 --push .
- docker buildx build -t $IMAGE_PREFIX/tournamentsystemmanager:$IMAGE_TAG -f TournamentSystemManager/Dockerfile --platform linux/arm64,linux/amd64 --push .
- docker buildx build -t $IMAGE_PREFIX/tournamentmanager:$IMAGE_TAG -f TournamentManager/Dockerfile --platform linux/arm64,linux/amd64 --push .
......@@ -147,7 +147,7 @@ publish-connecters-release:
variables:
IMAGE_TAG: latest
script:
- docker buildx build -t $IMAGE_PREFIX/signalbot:$IMAGE_TAG -f BotSignal/Dockerfile --platform linux/arm64,linux/amd64 --push .
- docker buildx build -t $IMAGE_PREFIX/signalbot:$IMAGE_TAG -f Bots.Signal/Dockerfile --platform linux/arm64,linux/amd64 --push .
- docker buildx build -t $IMAGE_PREFIX/signalrgui:$IMAGE_TAG -f GuiSignal/Dockerfile --platform linux/arm64,linux/amd64 --push .
only:
- release
......
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<UserSecretsId>f0b40b76-b230-4d94-b1d7-8ae0d57bd22e</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath>
<RootNamespace>BotSignal</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Botolution.ApiMsgLibrary" Version="2.0.7" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.5" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.9" />
<PackageReference Include="RabbitMQ.Client.Core.DependencyInjection" Version="4.3.0" />
<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
<PackageReference Include="Steeltoe.Extensions.Configuration.ConfigServerCore" Version="3.1.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BotManager\BotManager.csproj" />
<ProjectReference Include="..\ServiceHelper\ServiceHelper.csproj" />
</ItemGroup>
</Project>
FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build
WORKDIR /src
COPY ["nuget.config", "BotSignal/"]
COPY ["BotSignal/BotSignal.csproj", "BotSignal/"]
RUN dotnet restore "BotSignal/BotSignal.csproj"
COPY . .
WORKDIR "/src/BotSignal"
RUN dotnet build "BotSignal.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "BotSignal.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "BotSignal.dll"]
\ No newline at end of file

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
VisualStudioVersion = 17.1.32210.238
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Microservices", "Microservices", "{80296CB9-7209-4D11-BD26-F4F95DA18A99}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BotManager", "BotManager\BotManager.csproj", "{79736101-34CB-448C-9877-C8A3C3C48F29}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bots.Manager", "Bots.Manager\Bots.Manager.csproj", "{79736101-34CB-448C-9877-C8A3C3C48F29}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GameManager", "GameManager\GameManager.csproj", "{29DBAC49-D1A3-458C-9A56-083AFC40FD60}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Games.Manager", "Games.Manager\Games.Manager.csproj", "{29DBAC49-D1A3-458C-9A56-083AFC40FD60}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{DFE972F4-9A5C-4535-A48F-32A2E84425A5}"
EndProject
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{BB4D896A-5424-4B55-86B4-1D1C807FD6B3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MatchManager", "MatchManager\MatchManager.csproj", "{8CF18A86-EE55-45A3-A540-603ADF98CFE8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ServiceHelper", "ServiceHelper\ServiceHelper.csproj", "{042F45B0-D343-4C5B-8D5B-17CC3DE22BE3}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Matches.Manager", "Matches.Manager\Matches.Manager.csproj", "{8CF18A86-EE55-45A3-A540-603ADF98CFE8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GuiSignal", "GuiSignal\GuiSignal.csproj", "{A2DCF836-A69F-49E3-A0D0-71B079BC5010}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BotSignal", "BotSignal\BotSignal.csproj", "{909AE643-4143-4BD9-A9FE-F2430ED78AB8}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bots.Signal", "Bots.Signal\Bots.Signal.csproj", "{909AE643-4143-4BD9-A9FE-F2430ED78AB8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C5E6AF0A-FA6E-44E2-873B-2D72971ABEE2}"
ProjectSection(SolutionItems) = preProject
.gitlab-ci.yml = .gitlab-ci.yml
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UserManager", "UserManager\UserManager.csproj", "{93498F14-DB0F-469D-BFE7-529FAEED9621}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Users.Manager", "Users.Manager\Users.Manager.csproj", "{93498F14-DB0F-469D-BFE7-529FAEED9621}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TournamentSystemManager", "TournamentSystemManager\TournamentSystemManager.csproj", "{00CE6ADB-9496-4F27-ADE6-F61637B4A3F1}"
EndProject
......@@ -38,7 +36,39 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{1706B952-9
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MatchManager.IntegrationTests", "Tests\MatchManager.IntegrationTests\MatchManager.IntegrationTests.csproj", "{F1E24867-F324-4A69-8A57-0E89E1C5FBBB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MatchManager.UnitTests", "Tests\MatchManager.UnitTests\MatchManager.UnitTests.csproj", "{68F49734-FD08-45AF-9437-5FC2A01635C7}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MatchManager.UnitTests", "Tests\MatchManager.UnitTests\MatchManager.UnitTests.csproj", "{68F49734-FD08-45AF-9437-5FC2A01635C7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Matches", "Matches", "{A7A257BF-E1A0-4CCC-A3E8-493CD25C47AC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Matches.Contracts", "Matches.Contracts\Matches.Contracts.csproj", "{EF8F8E62-6167-4B9D-A706-D7ECAFE6732B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Bots", "Bots", "{9CCA5E52-F924-41EA-929F-A300EF0562A5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Games", "Games", "{EB09D5C3-AC42-46B1-BB98-CDEBB7F6BB40}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tournaments", "Tournaments", "{30012206-1041-434E-8A84-FB3A6F8E6755}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Users", "Users", "{8D597B5D-C434-4A6C-A3A8-897544A23005}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Gui", "Gui", "{4FD0575C-F6F6-4C45-81D2-32A4C3F9F5D7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Common", "Common\Common.csproj", "{13B3E5F8-B49E-48F2-8672-5D729AC70207}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bots.Contracts", "Bots.Contracts\Bots.Contracts.csproj", "{11DE0B0B-920D-453C-94EC-745B64914C67}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Common.Auth", "Common.Auth\Common.Auth.csproj", "{509A9A49-25D6-4658-96D1-082DAD1E6503}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Common.RabbitMQ", "Common.RabbitMQ\Common.RabbitMQ.csproj", "{35493DBF-4D16-4F02-B892-AAD62F5532D9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Common.MongoDB", "Common.MongoDB\Common.MongoDB.csproj", "{F3286809-3D7B-4CE6-AABC-198D9ABCFDD8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Games.Contracts", "Games.Contracts\Games.Contracts.csproj", "{23C4798B-8FA7-4E1D-B415-8224C4973967}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Common.Logging", "Common.Logging\Common.Logging.csproj", "{4AD0EC73-4FB3-4179-84CD-CF99DB8E67A0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Users.Contracts", "Users.Contracts\Users.Contracts.csproj", "{5B44DD15-4AA9-4ABC-B287-D9DC1837BB58}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tournaments.Contracts", "Tournaments.Contracts\Tournaments.Contracts.csproj", "{15E9EE17-B4F6-4DD0-8956-8BFB6F9C106D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
......@@ -62,10 +92,6 @@ Global
{8CF18A86-EE55-45A3-A540-603ADF98CFE8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8CF18A86-EE55-45A3-A540-603ADF98CFE8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8CF18A86-EE55-45A3-A540-603ADF98CFE8}.Release|Any CPU.Build.0 = Release|Any CPU
{042F45B0-D343-4C5B-8D5B-17CC3DE22BE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{042F45B0-D343-4C5B-8D5B-17CC3DE22BE3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{042F45B0-D343-4C5B-8D5B-17CC3DE22BE3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{042F45B0-D343-4C5B-8D5B-17CC3DE22BE3}.Release|Any CPU.Build.0 = Release|Any CPU
{A2DCF836-A69F-49E3-A0D0-71B079BC5010}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A2DCF836-A69F-49E3-A0D0-71B079BC5010}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A2DCF836-A69F-49E3-A0D0-71B079BC5010}.Release|Any CPU.ActiveCfg = Release|Any CPU
......@@ -98,23 +124,78 @@ Global
{68F49734-FD08-45AF-9437-5FC2A01635C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{68F49734-FD08-45AF-9437-5FC2A01635C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{68F49734-FD08-45AF-9437-5FC2A01635C7}.Release|Any CPU.Build.0 = Release|Any CPU
{EF8F8E62-6167-4B9D-A706-D7ECAFE6732B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EF8F8E62-6167-4B9D-A706-D7ECAFE6732B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EF8F8E62-6167-4B9D-A706-D7ECAFE6732B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EF8F8E62-6167-4B9D-A706-D7ECAFE6732B}.Release|Any CPU.Build.0 = Release|Any CPU
{13B3E5F8-B49E-48F2-8672-5D729AC70207}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{13B3E5F8-B49E-48F2-8672-5D729AC70207}.Debug|Any CPU.Build.0 = Debug|Any CPU
{13B3E5F8-B49E-48F2-8672-5D729AC70207}.Release|Any CPU.ActiveCfg = Release|Any CPU
{13B3E5F8-B49E-48F2-8672-5D729AC70207}.Release|Any CPU.Build.0 = Release|Any CPU
{11DE0B0B-920D-453C-94EC-745B64914C67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{11DE0B0B-920D-453C-94EC-745B64914C67}.Debug|Any CPU.Build.0 = Debug|Any CPU
{11DE0B0B-920D-453C-94EC-745B64914C67}.Release|Any CPU.ActiveCfg = Release|Any CPU
{11DE0B0B-920D-453C-94EC-745B64914C67}.Release|Any CPU.Build.0 = Release|Any CPU
{509A9A49-25D6-4658-96D1-082DAD1E6503}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{509A9A49-25D6-4658-96D1-082DAD1E6503}.Debug|Any CPU.Build.0 = Debug|Any CPU
{509A9A49-25D6-4658-96D1-082DAD1E6503}.Release|Any CPU.ActiveCfg = Release|Any CPU
{509A9A49-25D6-4658-96D1-082DAD1E6503}.Release|Any CPU.Build.0 = Release|Any CPU
{35493DBF-4D16-4F02-B892-AAD62F5532D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{35493DBF-4D16-4F02-B892-AAD62F5532D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{35493DBF-4D16-4F02-B892-AAD62F5532D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{35493DBF-4D16-4F02-B892-AAD62F5532D9}.Release|Any CPU.Build.0 = Release|Any CPU
{F3286809-3D7B-4CE6-AABC-198D9ABCFDD8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F3286809-3D7B-4CE6-AABC-198D9ABCFDD8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F3286809-3D7B-4CE6-AABC-198D9ABCFDD8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F3286809-3D7B-4CE6-AABC-198D9ABCFDD8}.Release|Any CPU.Build.0 = Release|Any CPU
{23C4798B-8FA7-4E1D-B415-8224C4973967}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{23C4798B-8FA7-4E1D-B415-8224C4973967}.Debug|Any CPU.Build.0 = Debug|Any CPU
{23C4798B-8FA7-4E1D-B415-8224C4973967}.Release|Any CPU.ActiveCfg = Release|Any CPU
{23C4798B-8FA7-4E1D-B415-8224C4973967}.Release|Any CPU.Build.0 = Release|Any CPU
{4AD0EC73-4FB3-4179-84CD-CF99DB8E67A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4AD0EC73-4FB3-4179-84CD-CF99DB8E67A0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4AD0EC73-4FB3-4179-84CD-CF99DB8E67A0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4AD0EC73-4FB3-4179-84CD-CF99DB8E67A0}.Release|Any CPU.Build.0 = Release|Any CPU
{5B44DD15-4AA9-4ABC-B287-D9DC1837BB58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5B44DD15-4AA9-4ABC-B287-D9DC1837BB58}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5B44DD15-4AA9-4ABC-B287-D9DC1837BB58}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5B44DD15-4AA9-4ABC-B287-D9DC1837BB58}.Release|Any CPU.Build.0 = Release|Any CPU
{15E9EE17-B4F6-4DD0-8956-8BFB6F9C106D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{15E9EE17-B4F6-4DD0-8956-8BFB6F9C106D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{15E9EE17-B4F6-4DD0-8956-8BFB6F9C106D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{15E9EE17-B4F6-4DD0-8956-8BFB6F9C106D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{79736101-34CB-448C-9877-C8A3C3C48F29} = {80296CB9-7209-4D11-BD26-F4F95DA18A99}
{29DBAC49-D1A3-458C-9A56-083AFC40FD60} = {80296CB9-7209-4D11-BD26-F4F95DA18A99}
{8CF18A86-EE55-45A3-A540-603ADF98CFE8} = {80296CB9-7209-4D11-BD26-F4F95DA18A99}
{042F45B0-D343-4C5B-8D5B-17CC3DE22BE3} = {DFE972F4-9A5C-4535-A48F-32A2E84425A5}
{A2DCF836-A69F-49E3-A0D0-71B079BC5010} = {80296CB9-7209-4D11-BD26-F4F95DA18A99}
{909AE643-4143-4BD9-A9FE-F2430ED78AB8} = {80296CB9-7209-4D11-BD26-F4F95DA18A99}
{93498F14-DB0F-469D-BFE7-529FAEED9621} = {80296CB9-7209-4D11-BD26-F4F95DA18A99}
{00CE6ADB-9496-4F27-ADE6-F61637B4A3F1} = {80296CB9-7209-4D11-BD26-F4F95DA18A99}
{AA97A05F-B74D-488F-AA2F-9920152BAE15} = {80296CB9-7209-4D11-BD26-F4F95DA18A99}
{1738EF88-97AA-43BB-832D-D6FF45F941FB} = {80296CB9-7209-4D11-BD26-F4F95DA18A99}
{79736101-34CB-448C-9877-C8A3C3C48F29} = {9CCA5E52-F924-41EA-929F-A300EF0562A5}
{29DBAC49-D1A3-458C-9A56-083AFC40FD60} = {EB09D5C3-AC42-46B1-BB98-CDEBB7F6BB40}
{8CF18A86-EE55-45A3-A540-603ADF98CFE8} = {A7A257BF-E1A0-4CCC-A3E8-493CD25C47AC}
{A2DCF836-A69F-49E3-A0D0-71B079BC5010} = {4FD0575C-F6F6-4C45-81D2-32A4C3F9F5D7}
{909AE643-4143-4BD9-A9FE-F2430ED78AB8} = {9CCA5E52-F924-41EA-929F-A300EF0562A5}
{93498F14-DB0F-469D-BFE7-529FAEED9621} = {8D597B5D-C434-4A6C-A3A8-897544A23005}
{00CE6ADB-9496-4F27-ADE6-F61637B4A3F1} = {30012206-1041-434E-8A84-FB3A6F8E6755}
{AA97A05F-B74D-488F-AA2F-9920152BAE15} = {30012206-1041-434E-8A84-FB3A6F8E6755}
{1738EF88-97AA-43BB-832D-D6FF45F941FB} = {30012206-1041-434E-8A84-FB3A6F8E6755}
{F1E24867-F324-4A69-8A57-0E89E1C5FBBB} = {1706B952-9C29-43E6-8A4F-7CAAC74D14FE}
{68F49734-FD08-45AF-9437-5FC2A01635C7} = {1706B952-9C29-43E6-8A4F-7CAAC74D14FE}
{A7A257BF-E1A0-4CCC-A3E8-493CD25C47AC} = {80296CB9-7209-4D11-BD26-F4F95DA18A99}
{EF8F8E62-6167-4B9D-A706-D7ECAFE6732B} = {A7A257BF-E1A0-4CCC-A3E8-493CD25C47AC}
{9CCA5E52-F924-41EA-929F-A300EF0562A5} = {80296CB9-7209-4D11-BD26-F4F95DA18A99}
{EB09D5C3-AC42-46B1-BB98-CDEBB7F6BB40} = {80296CB9-7209-4D11-BD26-F4F95DA18A99}
{30012206-1041-434E-8A84-FB3A6F8E6755} = {80296CB9-7209-4D11-BD26-F4F95DA18A99}
{8D597B5D-C434-4A6C-A3A8-897544A23005} = {80296CB9-7209-4D11-BD26-F4F95DA18A99}
{4FD0575C-F6F6-4C45-81D2-32A4C3F9F5D7} = {80296CB9-7209-4D11-BD26-F4F95DA18A99}
{13B3E5F8-B49E-48F2-8672-5D729AC70207} = {DFE972F4-9A5C-4535-A48F-32A2E84425A5}
{11DE0B0B-920D-453C-94EC-745B64914C67} = {9CCA5E52-F924-41EA-929F-A300EF0562A5}
{509A9A49-25D6-4658-96D1-082DAD1E6503} = {DFE972F4-9A5C-4535-A48F-32A2E84425A5}
{35493DBF-4D16-4F02-B892-AAD62F5532D9} = {DFE972F4-9A5C-4535-A48F-32A2E84425A5}
{F3286809-3D7B-4CE6-AABC-198D9ABCFDD8} = {DFE972F4-9A5C-4535-A48F-32A2E84425A5}
{23C4798B-8FA7-4E1D-B415-8224C4973967} = {EB09D5C3-AC42-46B1-BB98-CDEBB7F6BB40}
{4AD0EC73-4FB3-4179-84CD-CF99DB8E67A0} = {DFE972F4-9A5C-4535-A48F-32A2E84425A5}
{5B44DD15-4AA9-4ABC-B287-D9DC1837BB58} = {8D597B5D-C434-4A6C-A3A8-897544A23005}
{15E9EE17-B4F6-4DD0-8956-8BFB6F9C106D} = {30012206-1041-434E-8A84-FB3A6F8E6755}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {48A88FDE-56AC-4819-9E4E-1C972C33C8FE}
......
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AssemblyName>Botolution.Platform.Bots.Contracts</AssemblyName>
<RootNamespace>Botolution.Platform.Bots</RootNamespace>
<VersionPrefix>1.0.0</VersionPrefix>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>
</Project>
using Newtonsoft.Json;
using System;
namespace Botolution.Platform.Bots.Commands.InitializeBot
{
public class InitializeBotRequest<InitType>
{
[JsonProperty("matchId")]
public Guid MatchId { get; set; }
[JsonProperty("initialization")]
public InitType Initialization { get; set; }
[JsonProperty("connectionId")]
public string ConnectionId {get; set;}
}
public class InitializeBotRequest : InitializeBotRequest<dynamic>
{
}
}
namespace Botolution.Platform.Bots.Entities
{
public class Bot
{
public string Id { get; set; }
public string User { get; set; }
public string Name { get; set; }
public string Address { get; set; }
public string Status { get; set; }
public string Token { get; set; }
public string Description { get; set; }
public string Color { get; set; }
public string State { get; set; }
public string Game { get; set; }
}
}
\ No newline at end of file
using Botolution.Platform.Bots.Entities;
namespace Botolution.Platform.Bots.Events
{
public class DeregisterBotRequest
{
public Bot Bot { get; set; }
}
}
\ No newline at end of file
using Botolution.Platform.Bots.Entities;
namespace Botolution.Platform.Bots.Events
{
public class RegisterBotRequest
{
public Bot Bot { get; set; }
}
}
\ No newline at end of file
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<UserSecretsId>6b8bbd34-d065-4489-8c64-a2a71405b6d3</UserSecretsId>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<UserSecretsId>6b8bbd34-d065-4489-8c64-a2a71405b6d3</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath>
</PropertyGroup>
<AssemblyName>Botolution.Platform.Bots.Manager</AssemblyName>
<RootNamespace>Botolution.Platform.Bots</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="8.1.1" />
<PackageReference Include="Botolution.ApiMsgLibrary" Version="2.0.7" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.11">
......@@ -26,7 +28,8 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ServiceHelper\ServiceHelper.csproj" />
<ProjectReference Include="..\Bots.Contracts\Bots.Contracts.csproj" />
<ProjectReference Include="..\Common.Logging\Common.Logging.csproj" />
</ItemGroup>
</Project>
......@@ -4,12 +4,11 @@ using System.Security.Claims;
using System.Threading.Tasks;
using AutoMapper;
using BotManager.Service;
using Botolution.ApiMsgLibrary.ApiMessages.GetBots;
using Botolution.ApiMsgLibrary.ApiObjects;
using Botolution.Platform.Bots.Entities;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using BotManagerModel = BotManager.DB.Model;
using Db = BotManager.DB.Model;
namespace BotManager.Controller
{
......@@ -30,29 +29,23 @@ namespace BotManager.Controller
}
[HttpGet]
public async Task<GetBotsResponse> Get()
public async Task<List<Bot>> Get()
{
var bots = await _botManagerService.GetAllReadyBots();
return new GetBotsResponse
{
Bots = _mapper.Map<List<Bot>>(bots)
};
return _mapper.Map<List<Bot>>(bots);
}
[Route("mybots")]
[HttpGet]
public async Task<GetBotsResponse> myBots()
public async Task<List<Bot>> MyBots()
{
var user = User.FindFirst(ClaimTypes.NameIdentifier)?.Value;
if (user != default)
{
var ownBots = await _botManagerService.GetUserBots(user);
return new GetBotsResponse
{
Bots = _mapper.Map<List<Bot>>(ownBots)
};
return _mapper.Map<List<Bot>>(ownBots); ;
}
return new GetBotsResponse();
return new List<Bot>();
}
[HttpGet("{botId}")]
......@@ -65,17 +58,14 @@ namespace BotManager.Controller
[Route("game/{game}")]
[HttpGet]
public async Task<GetBotsResponse> Get(string game, [FromQuery] string status = "Online")
public async Task<List<Bot>> Get(string game, [FromQuery] string status = "Online")
{
var bots = await _botManagerService.GetAllBots(game, status);
return new GetBotsResponse
{
Bots = _mapper.Map<List<BotManagerModel.Bot>, List<Bot>>(bots)
};
return _mapper.Map<List<Db.Bot>, List<Bot>>(bots);
}
[HttpPost("createbot")]
public IActionResult Post(BotManagerModel.Bot newBot)
public IActionResult Post(Db.Bot newBot)
{
string user = User.FindFirst(ClaimTypes.NameIdentifier)?.Value;
if(user != default && newBot.Id == default)
......@@ -118,7 +108,7 @@ namespace BotManager.Controller
}
[HttpPost("editbot")]
public async Task<IActionResult> editBotAsync(BotManagerModel.Bot bot)
public async Task<IActionResult> editBotAsync(Db.Bot bot)
{
string user = User.FindFirst(ClaimTypes.NameIdentifier)?.Value;
var dbBot = await _botManagerService.GetBot(bot.Id);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment