perf: 优化主题查询

This commit is contained in:
橙子
2025-01-18 01:07:38 +08:00
parent 6482218a68
commit 3be5675828
3 changed files with 22 additions and 11 deletions

View File

@@ -8,9 +8,12 @@ namespace Yi.Framework.Bbs.Domain.Entities.Forum
{
[SugarTable("Discuss")]
[SugarIndex($"index_{nameof(Title)}", nameof(Title), OrderByType.Asc)]
[SugarIndex($"index_{nameof(PlateId)}", nameof(PlateId), OrderByType.Asc)]
[SugarIndex($"index_{nameof(CreatorId)}", nameof(CreatorId), OrderByType.Asc)]
[SugarIndex($"index_{nameof(CreationTime)}", nameof(CreationTime), OrderByType.Desc)]
[SugarIndex($"index_{nameof(IsDeleted)}_{nameof(PlateId)}_{nameof(CreatorId)}",
nameof(IsDeleted), OrderByType.Asc,
nameof(PlateId), OrderByType.Asc,
nameof(CreatorId), OrderByType.Asc
)]
public class DiscussAggregateRoot : AggregateRoot<Guid>, ISoftDelete, IAuditedObject
{
public DiscussAggregateRoot()