style: 修改聚合跟类命名
This commit is contained in:
@@ -9,7 +9,7 @@ namespace Yi.Framework.Bbs.Domain.Entities.Forum
|
||||
[SugarIndex($"index_{nameof(Name)}", nameof(Name), OrderByType.Asc)]
|
||||
[SugarIndex($"index_{nameof(ParentId)}", nameof(ParentId), OrderByType.Asc)]
|
||||
[SugarIndex($"index_{nameof(DiscussId)}", nameof(DiscussId), OrderByType.Asc)]
|
||||
public class ArticleEntity : Entity<Guid>, ISoftDelete, IAuditedObject
|
||||
public class ArticleAggregateRoot : AggregateRoot<Guid>, ISoftDelete, IAuditedObject
|
||||
{
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
|
||||
public override Guid Id { get; protected set; }
|
||||
@@ -26,7 +26,7 @@ namespace Yi.Framework.Bbs.Domain.Entities.Forum
|
||||
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
|
||||
public List<ArticleEntity>? Children { get; set; }
|
||||
public List<ArticleAggregateRoot>? Children { get; set; }
|
||||
|
||||
|
||||
public DateTime CreationTime { get; set; }
|
||||
@@ -50,14 +50,14 @@ namespace Yi.Framework.Bbs.Domain.Entities.Forum
|
||||
/// </summary>
|
||||
/// <param name="entities"></param>
|
||||
/// <returns></returns>
|
||||
public static List<ArticleEntity> Tile(this List<ArticleEntity> entities)
|
||||
public static List<ArticleAggregateRoot> Tile(this List<ArticleAggregateRoot> entities)
|
||||
{
|
||||
if (entities is null) return new List<ArticleEntity>();
|
||||
var result = new List<ArticleEntity>();
|
||||
if (entities is null) return new List<ArticleAggregateRoot>();
|
||||
var result = new List<ArticleAggregateRoot>();
|
||||
return StartRecursion(entities, result);
|
||||
}
|
||||
|
||||
private static List<ArticleEntity> StartRecursion(List<ArticleEntity> entities, List<ArticleEntity> result)
|
||||
private static List<ArticleAggregateRoot> StartRecursion(List<ArticleAggregateRoot> entities, List<ArticleAggregateRoot> result)
|
||||
{
|
||||
foreach (var entity in entities)
|
||||
{
|
||||
@@ -6,7 +6,7 @@ using Volo.Abp.Domain.Entities;
|
||||
namespace Yi.Framework.Bbs.Domain.Entities.Forum
|
||||
{
|
||||
[SugarTable("Banner")]
|
||||
public class BannerEntity : Entity<Guid>, ISoftDelete, IAuditedObject
|
||||
public class BannerAggregateRoot : AggregateRoot<Guid>, ISoftDelete, IAuditedObject
|
||||
{
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
|
||||
public override Guid Id { get; protected set; }
|
||||
@@ -13,16 +13,16 @@ namespace Yi.Framework.Bbs.Domain.Entities.Forum
|
||||
[SugarTable("Comment")]
|
||||
[SugarIndex($"index_{nameof(DiscussId)}", nameof(DiscussId), OrderByType.Asc)]
|
||||
[SugarIndex($"index_{nameof(ParentId)}", nameof(ParentId), OrderByType.Asc)]
|
||||
public class CommentEntity : Entity<Guid>, ISoftDelete, IAuditedObject
|
||||
public class CommentAggregateRoot : AggregateRoot<Guid>, ISoftDelete, IAuditedObject
|
||||
{
|
||||
/// <summary>
|
||||
/// 采用二维数组方式,不使用树形方式
|
||||
/// </summary>
|
||||
public CommentEntity()
|
||||
public CommentAggregateRoot()
|
||||
{
|
||||
}
|
||||
|
||||
public CommentEntity(Guid discussId)
|
||||
public CommentAggregateRoot(Guid discussId)
|
||||
{
|
||||
DiscussId = discussId;
|
||||
}
|
||||
@@ -45,20 +45,20 @@ namespace Yi.Framework.Bbs.Domain.Entities.Forum
|
||||
public Guid RootId { get; set; }
|
||||
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public List<CommentEntity> Children { get; set; } = new();
|
||||
public List<CommentAggregateRoot> Children { get; set; } = new();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 用户,评论人用户信息
|
||||
/// </summary>
|
||||
[Navigate(NavigateType.OneToOne, nameof(CreatorId))]
|
||||
public UserEntity CreateUser { get; set; }
|
||||
public UserAggregateRoot CreateUser { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 被评论的用户信息
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public UserEntity CommentedUser { get; set; }
|
||||
public UserAggregateRoot CommentedUser { get; set; }
|
||||
|
||||
public Guid? CreatorId { get; set; }
|
||||
|
||||
@@ -10,12 +10,12 @@ namespace Yi.Framework.Bbs.Domain.Entities.Forum
|
||||
[SugarIndex($"index_{nameof(Title)}", nameof(Title), OrderByType.Asc)]
|
||||
[SugarIndex($"index_{nameof(PlateId)}", nameof(PlateId), OrderByType.Asc)]
|
||||
[SugarIndex($"index_{nameof(CreationTime)}", nameof(CreationTime), OrderByType.Desc)]
|
||||
public class DiscussEntity : Entity<Guid>, ISoftDelete, IAuditedObject
|
||||
public class DiscussAggregateRoot : AggregateRoot<Guid>, ISoftDelete, IAuditedObject
|
||||
{
|
||||
public DiscussEntity()
|
||||
public DiscussAggregateRoot()
|
||||
{
|
||||
}
|
||||
public DiscussEntity(Guid plateId)
|
||||
public DiscussAggregateRoot(Guid plateId)
|
||||
{
|
||||
PlateId = plateId;
|
||||
}
|
||||
@@ -6,7 +6,7 @@ using Volo.Abp.Auditing;
|
||||
namespace Yi.Framework.Bbs.Domain.Entities.Forum
|
||||
{
|
||||
[SugarTable("Plate")]
|
||||
public class PlateEntity : Entity<Guid>, ISoftDelete, IAuditedObject
|
||||
public class PlateAggregateRoot : AggregateRoot<Guid>, ISoftDelete, IAuditedObject
|
||||
{
|
||||
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
|
||||
Reference in New Issue
Block a user