Browse Source

fix conflicts and errors

pull/79/head
berkansasmaz 5 years ago
parent
commit
b1cd80d6c7
No known key found for this signature in database GPG Key ID: 884D815C3F32BE00
  1. 3
      src/EventHub.Application.Contracts/Events/IEventAppService.cs
  2. 2
      src/EventHub.Application/Events/EventAppService.cs
  3. 58
      src/EventHub.Domain.Shared/Events/EventConsts.cs
  4. 2
      src/EventHub.Domain.Shared/Events/SessionConsts.cs
  5. 2
      src/EventHub.Domain.Shared/Events/TrackConsts.cs
  6. 2
      src/EventHub.Domain.Shared/Localization/EventHub/en.json
  7. 110
      src/EventHub.Domain.Shared/Web/EventHubUrlOptions.cs
  8. 30
      src/EventHub.Domain/Countries/Country.cs
  9. 1
      src/EventHub.Domain/Events/Registrations/EventRegistrationManager.cs
  10. 4
      src/EventHub.EntityFrameworkCore/EventHub.EntityFrameworkCore.csproj
  11. 4
      test/EventHub.Domain.Tests/Events/Event_Tests.cs

3
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<byte[]> GetCoverImageAsync(Guid id);
Task<IRemoteStreamContent> GetCoverImageAsync(Guid id);
}
public class AddSessionDto

2
src/EventHub.Application/Events/EventAppService.cs

@ -272,7 +272,7 @@ namespace EventHub.Events
await _eventRepository.UpdateAsync(@event);
}
public async Task<byte[]> GetCoverImageAsync(Guid id)
public async Task<IRemoteStreamContent> GetCoverImageAsync(Guid id)
{
var blobName = id.ToString();

58
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" };
}
}

2
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;

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

2
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",

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

30
src/EventHub.Domain/Countries/Country.cs

@ -4,21 +4,21 @@ using Volo.Abp.Domain.Entities;
namespace EventHub.Countries
{
public class Country : BasicAggregateRoot<Guid>
{
public string Name { get; private set; }
public class Country : BasicAggregateRoot<Guid>
{
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);
}
}
}

1
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;

4
src/EventHub.EntityFrameworkCore/EventHub.EntityFrameworkCore.csproj

@ -19,8 +19,8 @@
<ItemGroup>
<PackageReference Include="Volo.Abp.BlobStoring.Database.EntityFrameworkCore" Version="5.0.0-rc.1" />
<ProjectReference Include="..\EventHub.Domain\EventHub.Domain.csproj" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.PostgreSql" Version="5.0.0-rc.1" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.0-rc.*" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.PostgreSql" Version="5.0.0-rc.1" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.0" />
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="5.0.0-rc.1" />
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="5.0.0-rc.1" />
<PackageReference Include="Volo.Abp.Identity.EntityFrameworkCore" Version="5.0.0-rc.1" />

4
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);
}
}
}

Loading…
Cancel
Save