From 37ef059847fe39032fe58ac7c137688f0bc30a09 Mon Sep 17 00:00:00 2001 From: zoxexivo Date: Wed, 13 Jul 2022 22:06:10 +0300 Subject: [PATCH] update --- .drone.yml | 20 +++++++--- .../Players/Queries/GetByClubUrlNameQuery.cs | 31 ++++++++-------- .../GetPlayerIdsByClubAndPositionQuery.cs | 33 ++++++++--------- .../Players/Queries/GetPlayersByIdsQuery.cs | 31 ++++++++-------- .../Players/Queries/GetRandomPlayerQuery.cs | 29 +++++++-------- .../Players/Queries/GetRelatedPlayersQuery.cs | 31 ++++++++-------- .../Players/Queries/GetTopPlayersQuery.cs | 31 ++++++++-------- .../Players/Queries/PlayerGetByIdQuery.cs | 31 ++++++++-------- .../Players/Queries/PlayerGetByUrlName.cs | 31 ++++++++-------- .../Players/Queries/PlayerGetListQuery.cs | 37 +++++++++---------- .../Players/Queries/PlayerGetUrlsQuery.cs | 29 +++++++-------- .../Players/Queries/PlayerNextIdQuery.cs | 29 +++++++-------- .../Players/Queries/PlayersForCacheQuery.cs | 33 ++++++++--------- .../Players/Queries/SearchPlayerQuery.cs | 29 +++++++-------- src/Backend/Geen.Data/Geen.Data.csproj | 4 +- .../Application/Jobs/SportsSyncService.cs | 16 ++++++++ .../Application/Services/Json/JsonService.cs | 2 +- src/Backend/Geen.sln | 7 ++++ 18 files changed, 237 insertions(+), 217 deletions(-) create mode 100644 src/Backend/Geen.Jobs/Application/Jobs/SportsSyncService.cs diff --git a/.drone.yml b/.drone.yml index 2106280..06979f8 100644 --- a/.drone.yml +++ b/.drone.yml @@ -18,7 +18,16 @@ steps: - name: docker_sock path: /var/run/docker.sock commands: - - docker build --no-cache -t geen:1.0.0.$$DRONE_BUILD_NUMBER -f "build/Web.Dockerfile" --build-arg BUILD_NUMBER=1.0.0.$$DRONE_BUILD_NUMBER . + - docker build --no-cache -t geen-web:1.0.0.$$DRONE_BUILD_NUMBER -f "build/Web.Dockerfile" --build-arg BUILD_NUMBER=1.0.0.$$DRONE_BUILD_NUMBER . + + - name: build_jobs + image: docker:latest + volumes: + - name: docker_sock + path: /var/run/docker.sock + commands: + - docker build --no-cache -t geen-jobs:1.0.0.$$DRONE_BUILD_NUMBER -f "build/Jobs.Dockerfile" --build-arg BUILD_NUMBER=1.0.0.$$DRONE_BUILD_NUMBER . + - name: clear image: docker:dind @@ -29,8 +38,8 @@ steps: - name: docker_sock path: /var/run/docker.sock commands: - - docker stop geen || true - - docker rm geen || true + - docker stop geen-web || true + - docker rm geen-jobs || true - name: deploy image: docker:dind @@ -41,8 +50,9 @@ steps: - name: docker_sock path: /var/run/docker.sock commands: - - docker run -d -p 172.17.0.1:7000:7000 --volume /home/zoxexivo/static/htmls:/html/geen --restart always --name geen geen:1.0.0.$$DRONE_BUILD_NUMBER - + - docker run -d -p 172.17.0.1:7000:7000 --volume /home/zoxexivo/static/htmls:/html/geen --restart always --name geen-web geen:1.0.0.$$DRONE_BUILD_NUMBER + - docker run -d --restart always --name geen-jobs geen-jobs:1.0.0.$$DRONE_BUILD_NUMBER + volumes: - name: docker_sock host: diff --git a/src/Backend/Geen.Core/Domains/Players/Queries/GetByClubUrlNameQuery.cs b/src/Backend/Geen.Core/Domains/Players/Queries/GetByClubUrlNameQuery.cs index a06baa7..67ca259 100644 --- a/src/Backend/Geen.Core/Domains/Players/Queries/GetByClubUrlNameQuery.cs +++ b/src/Backend/Geen.Core/Domains/Players/Queries/GetByClubUrlNameQuery.cs @@ -3,25 +3,24 @@ using Geen.Core.Domains.Players.Repositories; using Geen.Core.Interfaces.Common; -namespace Geen.Core.Domains.Players.Queries +namespace Geen.Core.Domains.Players.Queries; + +public class PlayerGetByClubUrlNameQuery : IQuery>> +{ + public string ClubUrlName { get; set; } +} + +public class PlayerGetByClubUrlNameQueryHandler : IQueryHandler>> { - public class PlayerGetByClubUrlNameQuery : IQuery>> + private readonly IPlayerRepository _playerRepository; + + public PlayerGetByClubUrlNameQueryHandler(IPlayerRepository playerRepository) { - public string ClubUrlName { get; set; } + _playerRepository = playerRepository; } - public class PlayerGetByClubUrlNameQueryHandler : IQueryHandler>> + public Task> Execute(PlayerGetByClubUrlNameQuery query) { - private readonly IPlayerRepository _playerRepository; - - public PlayerGetByClubUrlNameQueryHandler(IPlayerRepository playerRepository) - { - _playerRepository = playerRepository; - } - - public Task> Execute(PlayerGetByClubUrlNameQuery query) - { - return _playerRepository.GetByClubUrlName(query.ClubUrlName); - } + return _playerRepository.GetByClubUrlName(query.ClubUrlName); } -} +} \ No newline at end of file diff --git a/src/Backend/Geen.Core/Domains/Players/Queries/GetPlayerIdsByClubAndPositionQuery.cs b/src/Backend/Geen.Core/Domains/Players/Queries/GetPlayerIdsByClubAndPositionQuery.cs index 72679cd..e53f919 100644 --- a/src/Backend/Geen.Core/Domains/Players/Queries/GetPlayerIdsByClubAndPositionQuery.cs +++ b/src/Backend/Geen.Core/Domains/Players/Queries/GetPlayerIdsByClubAndPositionQuery.cs @@ -3,26 +3,25 @@ using Geen.Core.Domains.Players.Repositories; using Geen.Core.Interfaces.Common; -namespace Geen.Core.Domains.Players.Queries +namespace Geen.Core.Domains.Players.Queries; + +public class GetPlayerIdsByClubAndPositionQuery : IQuery>> +{ + public string ClubUrlName { get; set; } + public int Position { get; set; } +} + +public class GetPlayerIdsByClubAndPositionQueryHandler : IQueryHandler>> { - public class GetPlayerIdsByClubAndPositionQuery : IQuery>> + private readonly IPlayerRepository _playerRepository; + + public GetPlayerIdsByClubAndPositionQueryHandler(IPlayerRepository playerRepository) { - public string ClubUrlName { get; set; } - public int Position { get; set; } + _playerRepository = playerRepository; } - public class GetPlayerIdsByClubAndPositionQueryHandler : IQueryHandler>> + public Task> Execute(GetPlayerIdsByClubAndPositionQuery query) { - private readonly IPlayerRepository _playerRepository; - - public GetPlayerIdsByClubAndPositionQueryHandler(IPlayerRepository playerRepository) - { - _playerRepository = playerRepository; - } - - public Task> Execute(GetPlayerIdsByClubAndPositionQuery query) - { - return _playerRepository.GetIdsByClubAndPosition(query.ClubUrlName, query.Position); - } + return _playerRepository.GetIdsByClubAndPosition(query.ClubUrlName, query.Position); } -} +} \ No newline at end of file diff --git a/src/Backend/Geen.Core/Domains/Players/Queries/GetPlayersByIdsQuery.cs b/src/Backend/Geen.Core/Domains/Players/Queries/GetPlayersByIdsQuery.cs index 75d4137..849cf1d 100644 --- a/src/Backend/Geen.Core/Domains/Players/Queries/GetPlayersByIdsQuery.cs +++ b/src/Backend/Geen.Core/Domains/Players/Queries/GetPlayersByIdsQuery.cs @@ -3,25 +3,24 @@ using Geen.Core.Domains.Players.Repositories; using Geen.Core.Interfaces.Common; -namespace Geen.Core.Domains.Players.Queries +namespace Geen.Core.Domains.Players.Queries; + +public class GetPlayerModelsByIdsQuery : IQuery>> +{ + public List PlayerIds { get; set; } +} + +public class GetPlayerModelsByIdsQueryHandler : IQueryHandler>> { - public class GetPlayerModelsByIdsQuery : IQuery>> + private readonly IPlayerRepository _playerRepository; + + public GetPlayerModelsByIdsQueryHandler(IPlayerRepository playerRepository) { - public List PlayerIds { get; set; } + _playerRepository = playerRepository; } - public class GetPlayerModelsByIdsQueryHandler : IQueryHandler>> + public Task> Execute(GetPlayerModelsByIdsQuery query) { - private readonly IPlayerRepository _playerRepository; - - public GetPlayerModelsByIdsQueryHandler(IPlayerRepository playerRepository) - { - _playerRepository = playerRepository; - } - - public Task> Execute(GetPlayerModelsByIdsQuery query) - { - return _playerRepository.GetByIds(query.PlayerIds); - } + return _playerRepository.GetByIds(query.PlayerIds); } -} +} \ No newline at end of file diff --git a/src/Backend/Geen.Core/Domains/Players/Queries/GetRandomPlayerQuery.cs b/src/Backend/Geen.Core/Domains/Players/Queries/GetRandomPlayerQuery.cs index 0f6227d..3b2c418 100644 --- a/src/Backend/Geen.Core/Domains/Players/Queries/GetRandomPlayerQuery.cs +++ b/src/Backend/Geen.Core/Domains/Players/Queries/GetRandomPlayerQuery.cs @@ -2,24 +2,23 @@ using Geen.Core.Domains.Players.Repositories; using Geen.Core.Interfaces.Common; -namespace Geen.Core.Domains.Players.Queries +namespace Geen.Core.Domains.Players.Queries; + +public class GetRandomPlayerQuery : IQuery> +{ +} + +public class GetRandomPlayerQueryHandler : IQueryHandler> { - public class GetRandomPlayerQuery : IQuery> + private readonly IPlayerRepository _playerRepository; + + public GetRandomPlayerQueryHandler(IPlayerRepository playerRepository) { + _playerRepository = playerRepository; } - public class GetRandomPlayerQueryHandler : IQueryHandler> + public Task Execute(GetRandomPlayerQuery query) { - private readonly IPlayerRepository _playerRepository; - - public GetRandomPlayerQueryHandler(IPlayerRepository playerRepository) - { - _playerRepository = playerRepository; - } - - public Task Execute(GetRandomPlayerQuery query) - { - return _playerRepository.GetRandom(); - } + return _playerRepository.GetRandom(); } -} +} \ No newline at end of file diff --git a/src/Backend/Geen.Core/Domains/Players/Queries/GetRelatedPlayersQuery.cs b/src/Backend/Geen.Core/Domains/Players/Queries/GetRelatedPlayersQuery.cs index 283c422..4eb3b85 100644 --- a/src/Backend/Geen.Core/Domains/Players/Queries/GetRelatedPlayersQuery.cs +++ b/src/Backend/Geen.Core/Domains/Players/Queries/GetRelatedPlayersQuery.cs @@ -3,25 +3,24 @@ using Geen.Core.Domains.Players.Repositories; using Geen.Core.Interfaces.Common; -namespace Geen.Core.Domains.Players.Queries +namespace Geen.Core.Domains.Players.Queries; + +public class GetRelatedPlayerQuery : IQuery>> +{ + public string UrlName { get; set; } +} + +public class GetRelatedPlayerQueryHandler : IQueryHandler>> { - public class GetRelatedPlayerQuery : IQuery>> + private readonly IPlayerRepository _playerRepository; + + public GetRelatedPlayerQueryHandler(IPlayerRepository playerRepository) { - public string UrlName { get; set; } + _playerRepository = playerRepository; } - public class GetRelatedPlayerQueryHandler : IQueryHandler>> + public Task> Execute(GetRelatedPlayerQuery query) { - private readonly IPlayerRepository _playerRepository; - - public GetRelatedPlayerQueryHandler(IPlayerRepository playerRepository) - { - _playerRepository = playerRepository; - } - - public Task> Execute(GetRelatedPlayerQuery query) - { - return _playerRepository.GetRelatedPlayers(query.UrlName); - } + return _playerRepository.GetRelatedPlayers(query.UrlName); } -} +} \ No newline at end of file diff --git a/src/Backend/Geen.Core/Domains/Players/Queries/GetTopPlayersQuery.cs b/src/Backend/Geen.Core/Domains/Players/Queries/GetTopPlayersQuery.cs index eaa8e04..4528d6c 100644 --- a/src/Backend/Geen.Core/Domains/Players/Queries/GetTopPlayersQuery.cs +++ b/src/Backend/Geen.Core/Domains/Players/Queries/GetTopPlayersQuery.cs @@ -3,25 +3,24 @@ using Geen.Core.Domains.Players.Repositories; using Geen.Core.Interfaces.Common; -namespace Geen.Core.Domains.Players.Queries +namespace Geen.Core.Domains.Players.Queries; + +public class GetTopPlayerQuery : IQuery>> +{ + public string ClubUrlName { get; set; } +} + +public class GetTopPlayerQueryHandler : IQueryHandler>> { - public class GetTopPlayerQuery : IQuery>> + private readonly IPlayerRepository _playerRepository; + + public GetTopPlayerQueryHandler(IPlayerRepository playerRepository) { - public string ClubUrlName { get; set; } + _playerRepository = playerRepository; } - public class GetTopPlayerQueryHandler : IQueryHandler>> + public Task> Execute(GetTopPlayerQuery query) { - private readonly IPlayerRepository _playerRepository; - - public GetTopPlayerQueryHandler(IPlayerRepository playerRepository) - { - _playerRepository = playerRepository; - } - - public Task> Execute(GetTopPlayerQuery query) - { - return _playerRepository.GetTopPlayers(query.ClubUrlName); - } + return _playerRepository.GetTopPlayers(query.ClubUrlName); } -} +} \ No newline at end of file diff --git a/src/Backend/Geen.Core/Domains/Players/Queries/PlayerGetByIdQuery.cs b/src/Backend/Geen.Core/Domains/Players/Queries/PlayerGetByIdQuery.cs index 27aaba7..5923025 100644 --- a/src/Backend/Geen.Core/Domains/Players/Queries/PlayerGetByIdQuery.cs +++ b/src/Backend/Geen.Core/Domains/Players/Queries/PlayerGetByIdQuery.cs @@ -2,25 +2,24 @@ using Geen.Core.Domains.Players.Repositories; using Geen.Core.Interfaces.Common; -namespace Geen.Core.Domains.Players.Queries +namespace Geen.Core.Domains.Players.Queries; + +public class PlayerGetByIdQuery : IQuery> +{ + public int Id { get; set; } +} + +public class PlayerGetByIdQueryHandler : IQueryHandler> { - public class PlayerGetByIdQuery : IQuery> + private readonly IPlayerRepository _playerRepository; + + public PlayerGetByIdQueryHandler(IPlayerRepository playerRepository) { - public int Id { get; set; } + _playerRepository = playerRepository; } - public class PlayerGetByIdQueryHandler : IQueryHandler> + public Task Execute(PlayerGetByIdQuery query) { - private readonly IPlayerRepository _playerRepository; - - public PlayerGetByIdQueryHandler(IPlayerRepository playerRepository) - { - _playerRepository = playerRepository; - } - - public Task Execute(PlayerGetByIdQuery query) - { - return _playerRepository.GetById(query.Id); - } + return _playerRepository.GetById(query.Id); } -} +} \ No newline at end of file diff --git a/src/Backend/Geen.Core/Domains/Players/Queries/PlayerGetByUrlName.cs b/src/Backend/Geen.Core/Domains/Players/Queries/PlayerGetByUrlName.cs index 8b5da29..8d1f223 100644 --- a/src/Backend/Geen.Core/Domains/Players/Queries/PlayerGetByUrlName.cs +++ b/src/Backend/Geen.Core/Domains/Players/Queries/PlayerGetByUrlName.cs @@ -2,25 +2,24 @@ using Geen.Core.Domains.Players.Repositories; using Geen.Core.Interfaces.Common; -namespace Geen.Core.Domains.Players.Queries +namespace Geen.Core.Domains.Players.Queries; + +public class PlayerGetByUrlName : IQuery> +{ + public string UrlName { get; set; } +} + +public class PlayerGetByUrlNameQueryHandler : IQueryHandler> { - public class PlayerGetByUrlName : IQuery> + private readonly IPlayerRepository _playerRepository; + + public PlayerGetByUrlNameQueryHandler(IPlayerRepository playerRepository) { - public string UrlName { get; set; } + _playerRepository = playerRepository; } - public class PlayerGetByUrlNameQueryHandler : IQueryHandler> + public Task Execute(PlayerGetByUrlName query) { - private readonly IPlayerRepository _playerRepository; - - public PlayerGetByUrlNameQueryHandler(IPlayerRepository playerRepository) - { - _playerRepository = playerRepository; - } - - public Task Execute(PlayerGetByUrlName query) - { - return _playerRepository.GetByUrlName(query.UrlName); - } + return _playerRepository.GetByUrlName(query.UrlName); } -} +} \ No newline at end of file diff --git a/src/Backend/Geen.Core/Domains/Players/Queries/PlayerGetListQuery.cs b/src/Backend/Geen.Core/Domains/Players/Queries/PlayerGetListQuery.cs index 2ec4137..dcce6a4 100644 --- a/src/Backend/Geen.Core/Domains/Players/Queries/PlayerGetListQuery.cs +++ b/src/Backend/Geen.Core/Domains/Players/Queries/PlayerGetListQuery.cs @@ -3,29 +3,28 @@ using Geen.Core.Domains.Players.Repositories; using Geen.Core.Interfaces.Common; -namespace Geen.Core.Domains.Players.Queries +namespace Geen.Core.Domains.Players.Queries; + +public class PlayerGetListQuery : IQuery>> { - public class PlayerGetListQuery : IQuery>> - { - public string Query{ get;set; } + public string Query { get;set; } - public string ClubUrlName { get; set; } + public string ClubUrlName { get; set; } - public int Page { get; set; } - } + public int Page { get; set; } +} - public class PlayerGetListQueryHandler : IQueryHandler>> - { - private readonly IPlayerRepository _playerRepository; +public class PlayerGetListQueryHandler : IQueryHandler>> +{ + private readonly IPlayerRepository _playerRepository; - public PlayerGetListQueryHandler(IPlayerRepository playerRepository) - { - _playerRepository = playerRepository; - } + public PlayerGetListQueryHandler(IPlayerRepository playerRepository) + { + _playerRepository = playerRepository; + } - public Task> Execute(PlayerGetListQuery query) - { - return _playerRepository.GetList(query.Query, query.ClubUrlName, query.Page); - } + public Task> Execute(PlayerGetListQuery query) + { + return _playerRepository.GetList(query.Query, query.ClubUrlName, query.Page); } -} +} \ No newline at end of file diff --git a/src/Backend/Geen.Core/Domains/Players/Queries/PlayerGetUrlsQuery.cs b/src/Backend/Geen.Core/Domains/Players/Queries/PlayerGetUrlsQuery.cs index 2a6a96e..3328ab1 100644 --- a/src/Backend/Geen.Core/Domains/Players/Queries/PlayerGetUrlsQuery.cs +++ b/src/Backend/Geen.Core/Domains/Players/Queries/PlayerGetUrlsQuery.cs @@ -3,24 +3,23 @@ using Geen.Core.Domains.Players.Repositories; using Geen.Core.Interfaces.Common; -namespace Geen.Core.Domains.Players.Queries +namespace Geen.Core.Domains.Players.Queries; + +public class PlayerGetUrlsQuery : IQuery>> +{ +} + +public class PlayerGetUrlsQueryHandler : IQueryHandler>> { - public class PlayerGetUrlsQuery : IQuery>> + private readonly IPlayerRepository _playerRepository; + + public PlayerGetUrlsQueryHandler(IPlayerRepository playerRepository) { + _playerRepository = playerRepository; } - public class PlayerGetUrlsQueryHandler : IQueryHandler>> + public Task> Execute(PlayerGetUrlsQuery query) { - private readonly IPlayerRepository _playerRepository; - - public PlayerGetUrlsQueryHandler(IPlayerRepository playerRepository) - { - _playerRepository = playerRepository; - } - - public Task> Execute(PlayerGetUrlsQuery query) - { - return _playerRepository.GetUrls(); - } + return _playerRepository.GetUrls(); } -} +} \ No newline at end of file diff --git a/src/Backend/Geen.Core/Domains/Players/Queries/PlayerNextIdQuery.cs b/src/Backend/Geen.Core/Domains/Players/Queries/PlayerNextIdQuery.cs index 817036b..93f2222 100644 --- a/src/Backend/Geen.Core/Domains/Players/Queries/PlayerNextIdQuery.cs +++ b/src/Backend/Geen.Core/Domains/Players/Queries/PlayerNextIdQuery.cs @@ -2,24 +2,23 @@ using Geen.Core.Domains.Players.Repositories; using Geen.Core.Interfaces.Common; -namespace Geen.Core.Domains.Players.Queries +namespace Geen.Core.Domains.Players.Queries; + +public class PlayerNextIdQuery : IQuery> +{ +} + +public class PlayerModelNextIdQueryHandler : IQueryHandler> { - public class PlayerNextIdQuery : IQuery> + private readonly IPlayerRepository _playerRepository; + + public PlayerModelNextIdQueryHandler(IPlayerRepository playerRepository) { + _playerRepository = playerRepository; } - public class PlayerModelNextIdQueryHandler : IQueryHandler> + public Task Execute(PlayerNextIdQuery query) { - private readonly IPlayerRepository _playerRepository; - - public PlayerModelNextIdQueryHandler(IPlayerRepository playerRepository) - { - _playerRepository = playerRepository; - } - - public Task Execute(PlayerNextIdQuery query) - { - return _playerRepository.GetNextId(); - } + return _playerRepository.GetNextId(); } -} +} \ No newline at end of file diff --git a/src/Backend/Geen.Core/Domains/Players/Queries/PlayersForCacheQuery.cs b/src/Backend/Geen.Core/Domains/Players/Queries/PlayersForCacheQuery.cs index 27fc729..d4e2c24 100644 --- a/src/Backend/Geen.Core/Domains/Players/Queries/PlayersForCacheQuery.cs +++ b/src/Backend/Geen.Core/Domains/Players/Queries/PlayersForCacheQuery.cs @@ -3,26 +3,25 @@ using Geen.Core.Domains.Players.Repositories; using Geen.Core.Interfaces.Common; -namespace Geen.Core.Domains.Players.Queries +namespace Geen.Core.Domains.Players.Queries; + +public class PlayerForCacheQuery : IQuery>> +{ + public string ClubUrlName { get; set; } +} + +public class PlayerForCacheQueryHandler : IQueryHandler>> { - public class PlayerForCacheQuery : IQuery>> + private readonly IPlayerRepository _playerRepository; + + public PlayerForCacheQueryHandler(IPlayerRepository playerRepository) { - public string ClubUrlName { get; set; } + _playerRepository = playerRepository; } - public class PlayerForCacheQueryHandler : IQueryHandler>> + public async Task> Execute(PlayerForCacheQuery query) { - private readonly IPlayerRepository _playerRepository; - - public PlayerForCacheQueryHandler(IPlayerRepository playerRepository) - { - _playerRepository = playerRepository; - } - - public async Task> Execute(PlayerForCacheQuery query) - { - return new ConcurrentBag( - await _playerRepository.GetCached()); - } + return new ConcurrentBag( + await _playerRepository.GetCached()); } -} +} \ No newline at end of file diff --git a/src/Backend/Geen.Core/Domains/Players/Queries/SearchPlayerQuery.cs b/src/Backend/Geen.Core/Domains/Players/Queries/SearchPlayerQuery.cs index ad9c5c7..ee49cca 100644 --- a/src/Backend/Geen.Core/Domains/Players/Queries/SearchPlayerQuery.cs +++ b/src/Backend/Geen.Core/Domains/Players/Queries/SearchPlayerQuery.cs @@ -3,25 +3,24 @@ using Geen.Core.Domains.Players.Repositories; using Geen.Core.Interfaces.Common; -namespace Geen.Core.Domains.Players.Queries +namespace Geen.Core.Domains.Players.Queries; + +public class SearchPlayerQuery : IQuery>> +{ + public string Query { get; set; } +} + +public class SearchPlayerQueryHandler : IQueryHandler>> { - public class SearchPlayerQuery : IQuery>> + private readonly IPlayerRepository _playerRepository; + + public SearchPlayerQueryHandler(IPlayerRepository playerRepository) { - public string Query { get; set; } + _playerRepository = playerRepository; } - public class SearchPlayerQueryHandler : IQueryHandler>> + public Task> Execute(SearchPlayerQuery query) { - private readonly IPlayerRepository _playerRepository; - - public SearchPlayerQueryHandler(IPlayerRepository playerRepository) - { - _playerRepository = playerRepository; - } - - public Task> Execute(SearchPlayerQuery query) - { - return _playerRepository.Search(query.Query, 5); - } + return _playerRepository.Search(query.Query, 5); } } \ No newline at end of file diff --git a/src/Backend/Geen.Data/Geen.Data.csproj b/src/Backend/Geen.Data/Geen.Data.csproj index ddaa3b7..9362c33 100644 --- a/src/Backend/Geen.Data/Geen.Data.csproj +++ b/src/Backend/Geen.Data/Geen.Data.csproj @@ -6,8 +6,8 @@ - - + + diff --git a/src/Backend/Geen.Jobs/Application/Jobs/SportsSyncService.cs b/src/Backend/Geen.Jobs/Application/Jobs/SportsSyncService.cs new file mode 100644 index 0000000..acccd46 --- /dev/null +++ b/src/Backend/Geen.Jobs/Application/Jobs/SportsSyncService.cs @@ -0,0 +1,16 @@ +using Microsoft.Extensions.Hosting; + +namespace Geen.Jobs.Application.Jobs; + +public class SportsSyncService : IHostedService +{ + public Task StartAsync(CancellationToken cancellationToken) + { + return Task.CompletedTask; + } + + public Task StopAsync(CancellationToken cancellationToken) + { + return Task.CompletedTask; + } +} \ No newline at end of file diff --git a/src/Backend/Geen.Web/Application/Services/Json/JsonService.cs b/src/Backend/Geen.Web/Application/Services/Json/JsonService.cs index ec009b4..9659d39 100644 --- a/src/Backend/Geen.Web/Application/Services/Json/JsonService.cs +++ b/src/Backend/Geen.Web/Application/Services/Json/JsonService.cs @@ -6,7 +6,7 @@ namespace Geen.Web.Application.Services.Json { public static class JsonService { - private static readonly JsonSerializerOptions JsonSerializerOptions = new JsonSerializerOptions + private static readonly JsonSerializerOptions JsonSerializerOptions = new() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase }; diff --git a/src/Backend/Geen.sln b/src/Backend/Geen.sln index 2704ed2..c0f240a 100644 --- a/src/Backend/Geen.sln +++ b/src/Backend/Geen.sln @@ -13,6 +13,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{91552B37 ProjectSection(SolutionItems) = preProject ..\..\build\Web.Dockerfile = ..\..\build\Web.Dockerfile ..\..\build\Frontend.Dockerfile = ..\..\build\Frontend.Dockerfile + ..\..\build\Jobs.Dockerfile = ..\..\build\Jobs.Dockerfile EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Deploy", "Deploy", "{EAD68AC0-D5B9-4324-A827-2E4E9DA664D0}" @@ -20,6 +21,8 @@ ProjectSection(SolutionItems) = preProject ..\..\.drone.yml = ..\..\.drone.yml EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Geen.Jobs", "Geen.Jobs\Geen.Jobs.csproj", "{5FF04ABB-E63F-410E-8FD4-8F3F8F466D26}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -38,6 +41,10 @@ Global {98E3E6BC-2720-485F-84C1-8309BDB97B92}.Debug|Any CPU.Build.0 = Debug|Any CPU {98E3E6BC-2720-485F-84C1-8309BDB97B92}.Release|Any CPU.ActiveCfg = Release|Any CPU {98E3E6BC-2720-485F-84C1-8309BDB97B92}.Release|Any CPU.Build.0 = Release|Any CPU + {5FF04ABB-E63F-410E-8FD4-8F3F8F466D26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5FF04ABB-E63F-410E-8FD4-8F3F8F466D26}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5FF04ABB-E63F-410E-8FD4-8F3F8F466D26}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5FF04ABB-E63F-410E-8FD4-8F3F8F466D26}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE