Merge branch 'framework' of https://gitee.com/ccnetcore/Yi into framework

# Conflicts:
#	Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application.Contracts/Forum/Dtos/Comment/CommentGetListOutputDto.cs
This commit is contained in:
陈淳
2023-03-24 17:15:46 +08:00
7 changed files with 164 additions and 18 deletions

View File

@@ -10,7 +10,7 @@ namespace Yi.BBS.Application.Contracts.Forum.Dtos
{
public class CommentGetListInputVo
{
public DateTime? CreateTime { get; set; }
public DateTime? creationTime { get; set; }
public string? Content { get; set; }
//Ӧ<><D3A6>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ī<EFBFBD><C4AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ

View File

@@ -16,7 +16,9 @@ namespace Yi.BBS.Application.Contracts.Forum.Dtos
{
public long Id { get; set; }
public DateTime? CreateTime { get; set; }
public DateTime? CreationTime { get; set; }
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3><EFBFBD><EFBFBD>ܿ<EFBFBD><DCBF><EFBFBD>

View File

@@ -50,7 +50,7 @@ namespace Yi.BBS.Application.Forum
.ToListAsync();
//结果初始值,第一层等于全部根节点
var outPut = entities.Where(x => x.ParentId == 0).ToList();
var outPut = entities.Where(x => x.ParentId == 0).OrderByDescending(x=>x.CreationTime).ToList();
//将全部数据进行hash
var dic = entities.ToDictionary(x => x.Id);
@@ -73,9 +73,17 @@ namespace Yi.BBS.Application.Forum
}
}
//子类需要排序
outPut.ForEach(x =>
{
x.Children = x.Children.OrderByDescending(x => x.CreationTime).ToList();
});
//获取全量主题评论, 先获取顶级的,将其他子组合到顶级下,形成一个二维,先转成dto
List<CommentGetListOutputDto>? items = await MapToGetListOutputDtosAsync(outPut);
return new PagedResultDto<CommentGetListOutputDto>(0, items);
return new PagedResultDto<CommentGetListOutputDto>(entities.Count(), items);
}