From b1cd80d6c71648dd68146fe3f082c081b91216c6 Mon Sep 17 00:00:00 2001 From: berkansasmaz Date: Wed, 1 Dec 2021 16:18:37 +0300 Subject: [PATCH] fix conflicts and errors --- .../Events/IEventAppService.cs | 3 +- .../Events/EventAppService.cs | 2 +- .../Events/EventConsts.cs | 58 ++++----- .../Events/SessionConsts.cs | 2 +- .../Events/TrackConsts.cs | 2 +- .../Localization/EventHub/en.json | 2 +- .../Web/EventHubUrlOptions.cs | 110 +++++++++--------- src/EventHub.Domain/Countries/Country.cs | 30 ++--- .../Registrations/EventRegistrationManager.cs | 1 + .../EventHub.EntityFrameworkCore.csproj | 4 +- .../Events/Event_Tests.cs | 4 +- 11 files changed, 109 insertions(+), 109 deletions(-) diff --git a/src/EventHub.Application.Contracts/Events/IEventAppService.cs b/src/EventHub.Application.Contracts/Events/IEventAppService.cs index f9a68fa..8296d9b 100644 --- a/src/EventHub.Application.Contracts/Events/IEventAppService.cs +++ b/src/EventHub.Application.Contracts/Events/IEventAppService.cs @@ -4,6 +4,7 @@ using System.ComponentModel.DataAnnotations; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; +using Volo.Abp.Content; using Volo.Abp.SettingManagement; namespace EventHub.Events @@ -26,7 +27,7 @@ namespace EventHub.Events Task AddSessionAsync(Guid id, AddSessionDto input); - Task GetCoverImageAsync(Guid id); + Task GetCoverImageAsync(Guid id); } public class AddSessionDto diff --git a/src/EventHub.Application/Events/EventAppService.cs b/src/EventHub.Application/Events/EventAppService.cs index 60be452..b70bd38 100644 --- a/src/EventHub.Application/Events/EventAppService.cs +++ b/src/EventHub.Application/Events/EventAppService.cs @@ -272,7 +272,7 @@ namespace EventHub.Events await _eventRepository.UpdateAsync(@event); } - public async Task GetCoverImageAsync(Guid id) + public async Task GetCoverImageAsync(Guid id) { var blobName = id.ToString(); diff --git a/src/EventHub.Domain.Shared/Events/EventConsts.cs b/src/EventHub.Domain.Shared/Events/EventConsts.cs index 6e27a39..ab6aba1 100644 --- a/src/EventHub.Domain.Shared/Events/EventConsts.cs +++ b/src/EventHub.Domain.Shared/Events/EventConsts.cs @@ -1,32 +1,32 @@ namespace EventHub.Events { - public static class EventConsts - { - public const string DefaultSorting = "Title desc"; - - public const int UrlCodeLength = 8; - public const int MaxTitleInUrlLength = 60; - public const int MaxUrlLength = MaxTitleInUrlLength + 1 + UrlCodeLength; //Format: {Title}-{UrlCode} - - public const int MinTitleLength = 8; - public const int MaxTitleLength = 128; - - public const int MinDescriptionLength = 50; - public const int MaxDescriptionLength = 2000; - - public const int MinOnlineLinkLength = 4; - public const int MaxOnlineLinkLength = 2000; - - public const int MinCityLength = 2; - public const int MaxCityLength = 32; - - public const int MinLanguageLength = 2; - public const int MaxLanguageLength = 16; - - public const int MaxTimingChangeCountForUser = 2; - - public const int MaxCoverImageFileSize = 5 * 1024 * 1024; - - public static string[] AllowedCoverImageExtensions = { ".jpg", ".png" }; - } + public static class EventConsts + { + public const string DefaultSorting = "Title desc"; + + public const int UrlCodeLength = 8; + public const int MaxTitleInUrlLength = 60; + public const int MaxUrlLength = MaxTitleInUrlLength + 1 + UrlCodeLength; //Format: {Title}-{UrlCode} + + public const int MinTitleLength = 8; + public const int MaxTitleLength = 128; + + public const int MinDescriptionLength = 50; + public const int MaxDescriptionLength = 2000; + + public const int MinOnlineLinkLength = 4; + public const int MaxOnlineLinkLength = 2000; + + public const int MinCityLength = 2; + public const int MaxCityLength = 32; + + public const int MinLanguageLength = 2; + public const int MaxLanguageLength = 16; + + public const int MaxTimingChangeCountForUser = 2; + + public const int MaxCoverImageFileSize = 5 * 1024 * 1024; + + public static string[] AllowedCoverImageExtensions = { ".jpg", ".png" }; + } } diff --git a/src/EventHub.Domain.Shared/Events/SessionConsts.cs b/src/EventHub.Domain.Shared/Events/SessionConsts.cs index 8f7e304..1ee8817 100644 --- a/src/EventHub.Domain.Shared/Events/SessionConsts.cs +++ b/src/EventHub.Domain.Shared/Events/SessionConsts.cs @@ -1,6 +1,6 @@ namespace EventHub.Events { - public class SessionConsts + public static class SessionConsts { public const int MinTitleLength = 8; public const int MaxTitleLength = 128; diff --git a/src/EventHub.Domain.Shared/Events/TrackConsts.cs b/src/EventHub.Domain.Shared/Events/TrackConsts.cs index 71b1de5..b3fb99d 100644 --- a/src/EventHub.Domain.Shared/Events/TrackConsts.cs +++ b/src/EventHub.Domain.Shared/Events/TrackConsts.cs @@ -1,6 +1,6 @@ namespace EventHub.Events { - public class TrackConsts + public static class TrackConsts { public const int MaxNameLength = 64; } diff --git a/src/EventHub.Domain.Shared/Localization/EventHub/en.json b/src/EventHub.Domain.Shared/Localization/EventHub/en.json index 3d05d69..557c460 100644 --- a/src/EventHub.Domain.Shared/Localization/EventHub/en.json +++ b/src/EventHub.Domain.Shared/Localization/EventHub/en.json @@ -83,7 +83,7 @@ "CoverImagePreview": "Cover Image Preview", "EventTimingChangeSuccessMessage": "The time of the event has been changed successfully!", "PastEvent": "Past Event", - "EventHub:SessionEndTimeCantBeEarlierThanStartTime": "Session end time can not be earlier than the start time." + "EventHub:SessionEndTimeCantBeEarlierThanStartTime": "Session end time can not be earlier than the start time.", "Menu:OrganizationManagement": "Organization Management", "Menu:OrganizationMemberships": "Memberships", "Permission:OrganizationManagement": "Organization Management", diff --git a/src/EventHub.Domain.Shared/Web/EventHubUrlOptions.cs b/src/EventHub.Domain.Shared/Web/EventHubUrlOptions.cs index 9446c4d..36f16d6 100644 --- a/src/EventHub.Domain.Shared/Web/EventHubUrlOptions.cs +++ b/src/EventHub.Domain.Shared/Web/EventHubUrlOptions.cs @@ -2,64 +2,64 @@ namespace EventHub.Web { - public class EventHubUrlOptions - { - private const string ConfigurationName = "AppUrls"; - private const string AccountDefaultValue = "https://localhost:44313"; - private const string AdminDefaultValue = "https://localhost:44307"; - private const string WwwDefaultValue = "https://localhost:44308"; - private const string ApiDefaultValue = "https://localhost:44362"; - private const string ApiInternalDefaultValue = ApiDefaultValue; - private const string AdminApiDefaultValue = "https://localhost:44305"; + public class EventHubUrlOptions + { + private const string ConfigurationName = "AppUrls"; + private const string AccountDefaultValue = "https://localhost:44313"; + private const string AdminDefaultValue = "https://localhost:44307"; + private const string WwwDefaultValue = "https://localhost:44308"; + private const string ApiDefaultValue = "https://localhost:44362"; + private const string ApiInternalDefaultValue = ApiDefaultValue; + private const string AdminApiDefaultValue = "https://localhost:44305"; - public string Account { get; set; } = AccountDefaultValue; - public string Www { get; set; } = WwwDefaultValue; - public string Api { get; set; } = ApiDefaultValue; - public string ApiInternal { get; set; } = ApiInternalDefaultValue; - public string Admin { get; set; } = AdminDefaultValue; - public string AdminApi { get; set; } = AdminApiDefaultValue; + public string Account { get; set; } = AccountDefaultValue; + public string Www { get; set; } = WwwDefaultValue; + public string Api { get; set; } = ApiDefaultValue; + public string ApiInternal { get; set; } = ApiInternalDefaultValue; + public string Admin { get; set; } = AdminDefaultValue; + public string AdminApi { get; set; } = AdminApiDefaultValue; - public static string GetAccountConfigValue(IConfiguration configuration) - { - return GetConfigValue(configuration, nameof(Account), AccountDefaultValue); - } - - public static string GetWwwConfigValue(IConfiguration configuration) - { - return GetConfigValue(configuration, nameof(Www), WwwDefaultValue); - } - - public static string GetApiInternalConfigValue(IConfiguration configuration) - { - return GetConfigValue(configuration, nameof(ApiInternal), ApiInternalDefaultValue); - } + public static string GetAccountConfigValue(IConfiguration configuration) + { + return GetConfigValue(configuration, nameof(Account), AccountDefaultValue); + } - public static string GetApiConfigValue(IConfiguration configuration) - { - return GetConfigValue(configuration, nameof(Api), ApiDefaultValue); - } - - public static string GetAdminConfigValue(IConfiguration configuration) - { - return GetConfigValue(configuration, nameof(Admin), AdminDefaultValue); - } + public static string GetWwwConfigValue(IConfiguration configuration) + { + return GetConfigValue(configuration, nameof(Www), WwwDefaultValue); + } - public static string GetAdminApiConfigValue(IConfiguration configuration) - { - return GetConfigValue(configuration, nameof(AdminApi), AdminApiDefaultValue); - } + public static string GetApiInternalConfigValue(IConfiguration configuration) + { + return GetConfigValue(configuration, nameof(ApiInternal), ApiInternalDefaultValue); + } - private static string GetConfigKey(string appName) - { - return $"{ConfigurationName}:{appName}"; - } - - private static string GetConfigValue( - IConfiguration configuration, - string appName, - string defaultValue) - { - return configuration[GetConfigKey(appName)] ?? defaultValue; - } - } + public static string GetApiConfigValue(IConfiguration configuration) + { + return GetConfigValue(configuration, nameof(Api), ApiDefaultValue); + } + + public static string GetAdminConfigValue(IConfiguration configuration) + { + return GetConfigValue(configuration, nameof(Admin), AdminDefaultValue); + } + + public static string GetAdminApiConfigValue(IConfiguration configuration) + { + return GetConfigValue(configuration, nameof(AdminApi), AdminApiDefaultValue); + } + + private static string GetConfigKey(string appName) + { + return $"{ConfigurationName}:{appName}"; + } + + private static string GetConfigValue( + IConfiguration configuration, + string appName, + string defaultValue) + { + return configuration[GetConfigKey(appName)] ?? defaultValue; + } + } } \ No newline at end of file diff --git a/src/EventHub.Domain/Countries/Country.cs b/src/EventHub.Domain/Countries/Country.cs index 1c05c25..1a00f36 100644 --- a/src/EventHub.Domain/Countries/Country.cs +++ b/src/EventHub.Domain/Countries/Country.cs @@ -4,21 +4,21 @@ using Volo.Abp.Domain.Entities; namespace EventHub.Countries { - public class Country : BasicAggregateRoot - { - public string Name { get; private set; } + public class Country : BasicAggregateRoot + { + public string Name { get; private set; } - private Country() - { - - } + private Country() + { - internal Country( - Guid id, - string name) - : base(id) - { - Name = Check.NotNullOrWhiteSpace(name, nameof(name), CountryConsts.MaxNameLength); - } - } + } + + internal Country( + Guid id, + string name) + : base(id) + { + Name = Check.NotNullOrWhiteSpace(name, nameof(name), CountryConsts.MaxNameLength); + } + } } \ No newline at end of file diff --git a/src/EventHub.Domain/Events/Registrations/EventRegistrationManager.cs b/src/EventHub.Domain/Events/Registrations/EventRegistrationManager.cs index 58bb782..4f46edb 100644 --- a/src/EventHub.Domain/Events/Registrations/EventRegistrationManager.cs +++ b/src/EventHub.Domain/Events/Registrations/EventRegistrationManager.cs @@ -1,5 +1,6 @@ using System.Threading.Tasks; using Volo.Abp; +using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Services; using Volo.Abp.Guids; using Volo.Abp.Identity; diff --git a/src/EventHub.EntityFrameworkCore/EventHub.EntityFrameworkCore.csproj b/src/EventHub.EntityFrameworkCore/EventHub.EntityFrameworkCore.csproj index 1e10f87..3c6f376 100644 --- a/src/EventHub.EntityFrameworkCore/EventHub.EntityFrameworkCore.csproj +++ b/src/EventHub.EntityFrameworkCore/EventHub.EntityFrameworkCore.csproj @@ -19,8 +19,8 @@ - - + + diff --git a/test/EventHub.Domain.Tests/Events/Event_Tests.cs b/test/EventHub.Domain.Tests/Events/Event_Tests.cs index 6a49efd..e295449 100644 --- a/test/EventHub.Domain.Tests/Events/Event_Tests.cs +++ b/test/EventHub.Domain.Tests/Events/Event_Tests.cs @@ -44,8 +44,6 @@ namespace EventHub.Events //ASSERT evnt.StartTime.ShouldBe(newStartTime); evnt.EndTime.ShouldBe(newEndTime); - evnt.GetLocalEvents() - .ShouldContain(x => x.EventData is EventTimeChangingEventData); } [Fact] @@ -65,7 +63,7 @@ namespace EventHub.Events }); exception.Code.ShouldBe( - EventHubErrorCodes.EventEndTimeCantBeEarlierThanStartTime); + EventHubErrorCodes.EndTimeCantBeEarlierThanStartTime); } } }