From d8f8589a051dea1920b7ca2f415d6a21e5e0f4ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20=C3=87otur?= Date: Thu, 19 Mar 2020 19:42:37 +0300 Subject: [PATCH] etos' implemented --- .../Volo.Blogging.Domain.csproj | 1 + .../Blogging/BloggingDomainMappingProfile.cs | 19 ++++++++++++ .../Volo/Blogging/BloggingDomainModule.cs | 16 +++++++++- .../Volo/Blogging/Blogs/BlogEto.cs | 19 ++++++++++++ .../Volo/Blogging/Comments/CommentEto.cs | 15 ++++++++++ .../Volo/Blogging/Posts/PostEto.cs | 29 +++++++++++++++++++ .../Volo/Blogging/Tagging/TagEto.cs | 19 ++++++++++++ 7 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/BloggingDomainMappingProfile.cs create mode 100644 modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Blogs/BlogEto.cs create mode 100644 modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Comments/CommentEto.cs create mode 100644 modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Posts/PostEto.cs create mode 100644 modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Tagging/TagEto.cs diff --git a/modules/blogging/src/Volo.Blogging.Domain/Volo.Blogging.Domain.csproj b/modules/blogging/src/Volo.Blogging.Domain/Volo.Blogging.Domain.csproj index a7cbc2c7c6..73cf0498c5 100644 --- a/modules/blogging/src/Volo.Blogging.Domain/Volo.Blogging.Domain.csproj +++ b/modules/blogging/src/Volo.Blogging.Domain/Volo.Blogging.Domain.csproj @@ -13,6 +13,7 @@ + diff --git a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/BloggingDomainMappingProfile.cs b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/BloggingDomainMappingProfile.cs new file mode 100644 index 0000000000..da36b39049 --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/BloggingDomainMappingProfile.cs @@ -0,0 +1,19 @@ +using AutoMapper; +using Volo.Blogging.Blogs; +using Volo.Blogging.Comments; +using Volo.Blogging.Posts; +using Volo.Blogging.Tagging; + +namespace Volo.Blogging +{ + public class BloggingDomainMappingProfile : Profile + { + public BloggingDomainMappingProfile() + { + CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); + } + } +} \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/BloggingDomainModule.cs b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/BloggingDomainModule.cs index 4690546a7e..5a853cf894 100644 --- a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/BloggingDomainModule.cs +++ b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/BloggingDomainModule.cs @@ -1,5 +1,10 @@ using Volo.Abp.Domain; +using Volo.Abp.EventBus.Distributed; using Volo.Abp.Modularity; +using Volo.Blogging.Blogs; +using Volo.Blogging.Comments; +using Volo.Blogging.Posts; +using Volo.Blogging.Tagging; namespace Volo.Blogging { @@ -8,6 +13,15 @@ namespace Volo.Blogging typeof(AbpDddDomainModule))] public class BloggingDomainModule : AbpModule { - + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.EtoMappings.Add(); + options.EtoMappings.Add(); + options.EtoMappings.Add(); + options.EtoMappings.Add(); + }); + } } } diff --git a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Blogs/BlogEto.cs b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Blogs/BlogEto.cs new file mode 100644 index 0000000000..3fb3af4e08 --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Blogs/BlogEto.cs @@ -0,0 +1,19 @@ +using System; +using JetBrains.Annotations; + +namespace Volo.Blogging.Blogs +{ + public class BlogEto + { + public Guid Id { get; set; } + + [NotNull] + public string Name { get; set; } + + [NotNull] + public string ShortName { get; set; } + + [CanBeNull] + public string Description { get; set; } + } +} \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Comments/CommentEto.cs b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Comments/CommentEto.cs new file mode 100644 index 0000000000..fff54780be --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Comments/CommentEto.cs @@ -0,0 +1,15 @@ +using System; + +namespace Volo.Blogging.Comments +{ + public class CommentEto + { + public Guid Id { get; set; } + + public Guid PostId { get; set; } + + public Guid? RepliedCommentId { get; set; } + + public string Text { get; set; } + } +} \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Posts/PostEto.cs b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Posts/PostEto.cs new file mode 100644 index 0000000000..d3ef0d0f76 --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Posts/PostEto.cs @@ -0,0 +1,29 @@ +using JetBrains.Annotations; +using System; +using System.Collections.Generic; + +namespace Volo.Blogging.Posts +{ + public class PostEto + { + public Guid Id { get; set; } + + public Guid BlogId { get; set; } + + [NotNull] + public string Url { get; set; } + + [NotNull] + public string CoverImage { get; set; } + + [NotNull] + public string Title { get; set; } + + [CanBeNull] + public string Content { get; set; } + + public int ReadCount { get; set; } + + public ICollection Tags { get; set; } + } +} \ No newline at end of file diff --git a/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Tagging/TagEto.cs b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Tagging/TagEto.cs new file mode 100644 index 0000000000..3a83631885 --- /dev/null +++ b/modules/blogging/src/Volo.Blogging.Domain/Volo/Blogging/Tagging/TagEto.cs @@ -0,0 +1,19 @@ +using System; +using JetBrains.Annotations; + +namespace Volo.Blogging.Tagging +{ + public class TagEto + { + public Guid Id { get; set; } + + public Guid BlogId { get; set; } + + [NotNull] + public string Name { get; set; } + + public string Description { get; set; } + + public int UsageCount { get; set; } + } +} \ No newline at end of file