From 2b870358e99801a2707805f8bd1d262257120360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=B7=B3?= <454313500@qq.com> Date: Wed, 10 Jan 2024 09:12:30 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E7=BD=AE=E9=A1=B6=E6=98=BE=E7=A4=BA=EF=BC=8C=E5=90=8C=E6=97=B6?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Yi.Abp.Net8/.template.config/template.json | 23 +++++++++++++++++++ .../Dtos/Discuss/DiscussGetListInputVo.cs | 2 +- .../Services/DiscussService.cs | 5 +--- 3 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 Yi.Abp.Net8/.template.config/template.json diff --git a/Yi.Abp.Net8/.template.config/template.json b/Yi.Abp.Net8/.template.config/template.json new file mode 100644 index 00000000..b528eb5e --- /dev/null +++ b/Yi.Abp.Net8/.template.config/template.json @@ -0,0 +1,23 @@ +{ + "$schema": "http://json.schemastore.org/template", + "author": "ccnetcore", + "classifications": [ "Common", "Code" ], + "identity": "yi", + "name": "YI", + "shortName": "yi", + "sourceName": "Yi.Abp", + "tags": { + "language": "C#", + "type": "item" + }, + "sources": [ + { + "modifiers": [ + { + "exclude": [ "bin/**/*", "obj/**/*", "*.user", "*.vspscc", "*.vssscc", "*.cache",".git/**/*",".vs/**/*" ] + } + ] + } + ] + +} \ No newline at end of file diff --git a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/Dtos/Discuss/DiscussGetListInputVo.cs b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/Dtos/Discuss/DiscussGetListInputVo.cs index 7537de13..249060d1 100644 --- a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/Dtos/Discuss/DiscussGetListInputVo.cs +++ b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/Dtos/Discuss/DiscussGetListInputVo.cs @@ -10,7 +10,7 @@ namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Discuss public Guid? PlateId { get; set; } //默认查询非置顶 - public bool IsTop { get; set; } = false; + public bool? IsTop { 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 03ce3e9c..91b6a07d 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 @@ -106,10 +106,7 @@ namespace Yi.Framework.Bbs.Application.Services var items = await _forumManager._discussRepository._DbQueryable .WhereIF(!string.IsNullOrEmpty(input.Title), x => x.Title.Contains(input.Title)) .WhereIF(input.PlateId is not null, x => x.PlateId == input.PlateId) - - - .WhereIF(input.IsTop == true, x => x.IsTop == input.IsTop) - + .WhereIF(input.IsTop is not null,x=>x.IsTop==input.IsTop) .LeftJoin((discuss, user) => discuss.CreatorId == user.Id) .LeftJoin((discuss, user, info) => user.Id == info.UserId)