style: 修改聚合跟类命名

This commit is contained in:
橙子
2024-05-22 14:35:08 +08:00
parent f2e3c76539
commit 3429de9eb6
89 changed files with 446 additions and 412 deletions

View File

@@ -5,7 +5,7 @@ using Volo.Abp.Domain.Entities;
namespace Yi.Framework.Bbs.Domain.Entities
{
[SugarTable("AccessLog")]
public class AccessLogEntity : Entity<Guid>, IHasModificationTime, IHasCreationTime
public class AccessLogAggregateRoot : AggregateRoot<Guid>, IHasModificationTime, IHasCreationTime
{
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
public override Guid Id { get; protected set; }

View File

@@ -14,13 +14,13 @@ namespace Yi.Framework.Bbs.Domain.Entities.Bank
/// 银行卡
/// </summary>
[SugarTable("BankCard")]
public class BankCardEntity : Entity<Guid>, IHasCreationTime
public class BankCardAggregateRoot : AggregateRoot<Guid>, IHasCreationTime
{
public BankCardEntity()
public BankCardAggregateRoot()
{
}
public BankCardEntity(Guid userId)
public BankCardAggregateRoot(Guid userId)
{
this.UserId = userId;
}

View File

@@ -13,11 +13,11 @@ namespace Yi.Framework.Bbs.Domain.Entities.Bank
/// 利息记录
/// </summary>
[SugarTable("InterestRecords")]
public class InterestRecordsEntity : Entity<Guid>, IHasCreationTime
public class InterestRecordsAggregateRoot : AggregateRoot<Guid>, IHasCreationTime
{
public InterestRecordsEntity()
public InterestRecordsAggregateRoot()
{ }
public InterestRecordsEntity(decimal comparisonValue, decimal inputValue, bool isFluctuate = false)
public InterestRecordsAggregateRoot(decimal comparisonValue, decimal inputValue, bool isFluctuate = false)
{
ComparisonValue = comparisonValue;
Value = inputValue;

View File

@@ -0,0 +1,32 @@
namespace Yi.Framework.Bbs.Domain.Entities
{
public class BbsNoticeAggregateRoot
{
public Guid AcceptUserId { get; set; }
/// <summary>
/// 消息
/// </summary>
public string Message { get; set; }
public MessageTypeEnum MessageType { get; set; }
/// <summary>
/// 是否已读
/// </summary>
public bool IsRead { get; set; }
/// <summary>
/// 已读时间
/// </summary>
public DateTime? ReadTime { get; set; }
}
/// <summary>
/// 消息类型
/// </summary>
public enum MessageTypeEnum
{
}
}

View File

@@ -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)
{

View File

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

View File

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

View File

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

View File

@@ -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)]

View File

@@ -7,11 +7,11 @@ namespace Yi.Framework.Bbs.Domain.Entities.Integral
/// 等级表
/// </summary>
[SugarTable("Level")]
public class LevelEntity : Entity<Guid>
public class LevelAggregateRoot : AggregateRoot<Guid>
{
public LevelEntity() { }
public LevelAggregateRoot() { }
public LevelEntity(int currentLevel, string name, decimal minExperience)
public LevelAggregateRoot(int currentLevel, string name, decimal minExperience)
{
this.CurrentLevel = currentLevel;
this.Name = name;

View File

@@ -15,7 +15,7 @@ namespace Yi.Framework.Bbs.Domain.Entities.Integral
[SugarTable("SignIn")]
[SugarIndex($"index_{nameof(CreatorId)}", nameof(CreatorId), OrderByType.Asc)]
public class SignInEntity : Entity<Guid>, ICreationAuditedObject
public class SignInAggregateRoot : AggregateRoot<Guid>, ICreationAuditedObject
{
[SugarColumn(IsPrimaryKey = true)]

View File

@@ -4,7 +4,7 @@ using Volo.Abp.Domain.Entities;
namespace Yi.Framework.Bbs.Domain.Entities
{
[SugarTable("Setting")]
public class SettingEntity : Entity<Guid>
public class SettingAggregateRoot : AggregateRoot<Guid>
{
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]