From 461ea6c54de23306691719c4ca9963a48725fe94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A9=99=E5=AD=90?= <454313500@qq.com> Date: Thu, 4 Jan 2024 20:36:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=B8=BB=E9=A2=98=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E6=9D=BF=E5=9D=97=E5=85=B3=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dtos/Discuss/DiscussGetOutputDto.cs | 3 +++ .../Services/DiscussService.cs | 12 +++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/Dtos/Discuss/DiscussGetOutputDto.cs b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/Dtos/Discuss/DiscussGetOutputDto.cs index 104fb310..f05cbcf1 100644 --- a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/Dtos/Discuss/DiscussGetOutputDto.cs +++ b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/Dtos/Discuss/DiscussGetOutputDto.cs @@ -1,5 +1,6 @@ using Volo.Abp.Application.Dtos; using Yi.Framework.Bbs.Application.Contracts.Dtos.BbsUser; +using Yi.Framework.Bbs.Application.Contracts.Dtos.Plate; using Yi.Framework.Bbs.Domain.Shared.Enums; using Yi.Framework.Rbac.Application.Contracts.Dtos.User; @@ -37,5 +38,7 @@ namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Discuss public bool IsAgree { get; set; } = false; public List? PermissionUserIds { get; set; } public BbsUserGetListOutputDto User { get; set; } + + public PlateGetOutputDto Plate { get; set; } } } diff --git a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/DiscussService.cs b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/DiscussService.cs index fc620c26..03ce3e9c 100644 --- a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/DiscussService.cs +++ b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/DiscussService.cs @@ -58,7 +58,8 @@ namespace Yi.Framework.Bbs.Application.Services //查询主题发布 浏览主题 事件,浏览数+1 var item = await _forumManager._discussRepository._DbQueryable.LeftJoin((discuss, user) => discuss.CreatorId == user.Id) .LeftJoin((discuss, user, info) => user.Id == info.UserId) - .Select((discuss, user, info) => new DiscussGetOutputDto + .LeftJoin((discuss, user, info,plate) => plate.Id == discuss.PlateId) + .Select((discuss, user, info, plate) => new DiscussGetOutputDto { Id=discuss.Id, IsAgree = SqlFunc.Subqueryable().WhereIF(CurrentUser.Id != null, x => x.CreatorId == CurrentUser.Id && x.DiscussId == discuss.Id).Any(), @@ -70,6 +71,15 @@ namespace Yi.Framework.Bbs.Application.Services Id = user.Id, Level = info.Level, UserLimit = info.UserLimit + }, + Plate=new Contracts.Dtos.Plate.PlateGetOutputDto() + { + Name=plate.Name, + Id=plate.Id, + Code=plate.Code, + Introduction=plate.Introduction, + Logo=plate.Logo + } }, true) .SingleAsync(discuss => discuss.Id == id);