etos' implemented

pull/3240/head
Ahmet Çotur 6 years ago
parent c7c1aa2892
commit d8f8589a05

@ -13,6 +13,7 @@
<ItemGroup>
<ProjectReference Include="..\Volo.Blogging.Domain.Shared\Volo.Blogging.Domain.Shared.csproj" />
<ProjectReference Include="..\..\..\users\src\Volo.Abp.Users.Domain\Volo.Abp.Users.Domain.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AutoMapper\Volo.Abp.AutoMapper.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Ddd.Domain\Volo.Abp.Ddd.Domain.csproj" />
</ItemGroup>

@ -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<Blog, BlogEto>();
CreateMap<Comment, CommentEto>();
CreateMap<Post, PostEto>();
CreateMap<Tag, TagEto>();
}
}
}

@ -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<AbpDistributedEventBusOptions>(options =>
{
options.EtoMappings.Add<Blog, BlogEto>();
options.EtoMappings.Add<Comment, CommentEto>();
options.EtoMappings.Add<Post, PostEto>();
options.EtoMappings.Add<Tag, TagEto>();
});
}
}
}

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

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

@ -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<PostTag> Tags { get; set; }
}
}

@ -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; }
}
}
Loading…
Cancel
Save