更新 Admin.NET/Admin.NET.Core/Service/Region/SysRegionService.cs
添加查询行政区域列表接口
This commit is contained in:
parent
22a3da6508
commit
b6109fc1f5
@ -54,6 +54,24 @@ public class SysRegionService : IDynamicApiController, ITransient
|
||||
return await _sysRegionRep.GetListAsync(u => u.Pid == input.Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询行政区域列表 🔖
|
||||
/// post参数方便参数扩展,调用api不用大浮动修复,参数如果是对象不建议用[FromQuery]方式传参
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
[ApiDescriptionSettings(Name = "Query"), HttpPost]
|
||||
[DisplayName("查询行政区域列表")]
|
||||
public async Task<List<SysRegion>> 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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加行政区域 🔖
|
||||
/// </summary>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user