From b6109fc1f50c852db4672d1ff3a9e89ad0682b4e Mon Sep 17 00:00:00 2001 From: 362270511 <362270511@qq.com> Date: Sun, 20 Oct 2024 23:00:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20Admin.NET/Admin.NET.Core/S?= =?UTF-8?q?ervice/Region/SysRegionService.cs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加查询行政区域列表接口 --- .../Service/Region/SysRegionService.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Admin.NET/Admin.NET.Core/Service/Region/SysRegionService.cs b/Admin.NET/Admin.NET.Core/Service/Region/SysRegionService.cs index 6a4084c4..058fb3ef 100644 --- a/Admin.NET/Admin.NET.Core/Service/Region/SysRegionService.cs +++ b/Admin.NET/Admin.NET.Core/Service/Region/SysRegionService.cs @@ -54,6 +54,24 @@ public class SysRegionService : IDynamicApiController, ITransient return await _sysRegionRep.GetListAsync(u => u.Pid == input.Id); } + /// + /// 查询行政区域列表 🔖 + /// post参数方便参数扩展,调用api不用大浮动修复,参数如果是对象不建议用[FromQuery]方式传参 + /// + /// + /// + [ApiDescriptionSettings(Name = "Query"), HttpPost] + [DisplayName("查询行政区域列表")] + public async Task> QueryList(QueryRegionInput input) + { + return await _sysRegionRep.AsQueryable() + .WhereIF(input.Pid.HasValue, u => u.Pid == input.Pid) + .WhereIF(!string.IsNullOrWhiteSpace(input.Type), u => u.Type == input.Type) + .WhereIF(!string.IsNullOrWhiteSpace(input.Name), u => u.Name.Contains(input.Name)) + .WhereIF(!string.IsNullOrWhiteSpace(input.Code), u => u.Code.Contains(input.Code)) + .ToListAsync(); + } + /// /// 增加行政区域 🔖 ///